File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copy.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copy.java | |||
Method name: Map buildMap(Resource[], File, FileNameMapper)
|
Method name: void buildMap(File, File, String[], FileNameMapper, Hashtable)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Vector v = new Vector();↵ | 1 | Vector v = new Vector();↵ | |
2 | for (int i = 0; i < fromResources.length; i++) {↵ | 2 | for (int i = 0; i < names.length; i++) {↵ | |
3 | if (mapper.mapFileName(fromResources[i].getName()) != null) {↵ | 3 | if (mapper.mapFileName(names[i]) != null) {↵ | |
4 | v.addElement(fromResources[i]);↵ | 4 | v.addElement(names[i]);↵ | |
5 | }↵ | 5 | }↵ | |
6 | }↵ | 6 | }↵ | |
7 | toCopy = new Resource[v.size()];↵ | 7 | toCopy = new String[v.size()];↵ | |
8 | v.copyInto(toCopy); | 8 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | Vector v = new Vector(); | 3 | Vector v = new Vector(); | |||||||||||||||
5 | for (int i = 0; i < fromResources.length; i++) |
| 4 | for (int i = 0; i < names.length; i++) | ||||||||||||||
6 | if (mapper.mapFileName(fromResources[i].getName()) != null) |
| 5 | if (mapper.mapFileName(names[i]) != null) | ||||||||||||||
7 | v.addElement(fromResources[i]); |
| 6 | v.addElement(names[i]); | ||||||||||||||
|
| 7 | toCopy = new String[v.size()]; | |||||||||||||||
8 | toCopy = new Resource[v.size()]; |
| | |||||||||||||||
9 | v.copyInto(toCopy); |
| 8 | v.copyInto(toCopy); |
Row | Violation |
---|---|
1 | Type org.apache.tools.ant.types.Resource[] of variable fromResources does not match with type java.lang.String[] of variable names |
2 | Expression fromResources[i].getName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression names[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type org.apache.tools.ant.types.Resource[] of variable fromResources does not match with type java.lang.String[] of variable names |
5 | Unmatched statement toCopy=new String[v.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement toCopy=new Resource[v.size()]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Type org.apache.tools.ant.types.Resource[] of variable toCopy does not match with type java.lang.String[] of variable toCopy |