File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/Intersect.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/Difference.java | |||
Method name: Collection getCollection()
|
Method name: Collection getCollection()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | List rcs = getResourceCollections();↵ | 1 | List rc = getResourceCollections();↵ | |
2 | int size = rcs.size();↵ | 2 | int size = rc.size();↵ | |
3 | if (size < 2) {↵ | 3 | if (size < 2) {↵ | |
4 | throw new BuildException("The intersection of " + size↵ | 4 | throw new BuildException("The difference of " + size↵ | |
5 | + " resource collection" + ((size == 1) ? "" : "s")↵ | 5 | + " resource collection" + ((size == 1) ? "" : "s")↵ | |
6 | + " is undefined.");↵ | 6 | + " is undefined.");↵ | |
7 | }↵ | 7 | }↵ | |
8 | ArrayList al = new ArrayList(); | 8 | HashSet hs = new HashSet(); | |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
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) | 12.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | List rcs = getResourceCollections(); |
| 1 | List rc = getResourceCollections(); | |||||||||||||||||||||
2 | int size = rcs.size(); |
| 2 | int size = rc.size(); | |||||||||||||||||||||
3 | if (size < 2) | 3 | if (size < 2) | ||||||||||||||||||||||
4 | throw new BuildException("The intersection of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined."); |
| 4 | throw new BuildException("The difference of " + size + " resource collection" + ((size == 1) ? "" : "s") + " is undefined."); | |||||||||||||||||||||
5 | ArrayList al = new ArrayList(); |
| 5 | HashSet hs = new HashSet(); |
Row | Violation |
---|---|
1 | Expression new ArrayList() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new HashSet() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables rcs, al , while Clone fragment #2 returns variables rc, hs |