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 | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 16.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48 | OutputStreamWriter osw = null; |
| 43 | InputStreamReader isr = null; | |||||||||||||||||||||||||||||
49 | if (outputEncoding == null) |
| 44 | if (inputEncoding == null) | |||||||||||||||||||||||||||||
50 | osw = new OutputStreamWriter(dest.getOutputStream()); |
| 45 | isr = new InputStreamReader(source.getInputStream()); | |||||||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||||||||
51 | osw = new OutputStreamWriter(dest.getOutputStream(), outputEncoding); |
| 46 | isr = new InputStreamReader(source.getInputStream(), inputEncoding); | |||||||||||||||||||||||||||||
52 | out = new BufferedWriter(osw); |
| 47 | in = new BufferedReader(isr); |
Row | Violation |
---|---|
1 | Expression new OutputStreamWriter(dest.getOutputStream()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new InputStreamReader(source.getInputStream()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression dest.getOutputStream() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
4 | Expression source.getInputStream() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Expression new OutputStreamWriter(dest.getOutputStream(),outputEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression new InputStreamReader(source.getInputStream(),inputEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression dest.getOutputStream() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
8 | Expression source.getInputStream() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
9 | Expression new BufferedWriter(osw) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression new BufferedReader(isr) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Clone fragment #1 returns variable out with type java.io.BufferedWriter , while Clone fragment #2 returns variable in with type java.io.BufferedReader |