File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/ResourceUtils.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/ResourceUtils.java | |||
Method name: void copyResource(Resource, Resource, FilterSetCollection, Vector, boolean, boolean, String, String, Project)
|
Method name: void copyResource(Resource, Resource, FilterSetCollection, Vector, boolean, boolean, String, String, Project)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | OutputStreamWriter osw = null;↵ | 1 | InputStreamReader isr = null;↵ | |
2 | if (outputEncoding == null) {↵ | 2 | if (inputEncoding == null) {↵ | |
3 | osw = new OutputStreamWriter(dest.getOutputStream());↵ | 3 | isr = new InputStreamReader(source.getInputStream());↵ | |
4 | } else {↵ | 4 | } else {↵ | |
5 | osw = new OutputStreamWriter(dest.getOutputStream(),↵ | 5 | isr = new InputStreamReader(source.getInputStream(),↵ | |
6 | outputEncoding);↵ | 6 | inputEncoding);↵ | |
7 | }↵ | 7 | }↵ | |
8 | out = new BufferedWriter(osw); | 8 | in = new BufferedReader(isr); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 14 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
49 | if (outputEncoding == null) |
| 44 | if (inputEncoding == null) | ||||||||||
|
| 45 | isr = new InputStreamReader(source.getInputStream()); | |||||||||||
50 | osw = new OutputStreamWriter(dest.getOutputStream()); |
| | |||||||||||
else | | |||||||||||||
|
| 46 | isr = new InputStreamReader(source.getInputStream(), inputEncoding); | |||||||||||
51 | osw = new OutputStreamWriter(dest.getOutputStream(), outputEncoding); |
| |
Row | Violation |
---|---|
1 | Unmatched statement osw=new OutputStreamWriter(dest.getOutputStream()); cannot be moved, because it updates a variable modified in other unmapped statements |
2 | Unmatched statement osw=new OutputStreamWriter(dest.getOutputStream(),outputEncoding); cannot be moved, because it updates a variable modified in other unmapped statements |
3 | Unmatched statement isr=new InputStreamReader(source.getInputStream()); cannot be moved, because it updates a variable modified in other unmapped statements |
4 | Unmatched statement isr=new InputStreamReader(source.getInputStream(),inputEncoding); cannot be moved, because it updates a variable modified in other unmapped statements |