File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/AbstractFileSet.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/ArchiveResource.java | |||
Method name: boolean hasPatterns()
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 8 | |||
1 | if (isReference() && getProject() != null) {↵ | 1 | if (↵ | |
2 | return getRef(getProject()).hasPatterns();↵ | |||
3 | }↵ | |||
4 | if (defaultPatterns.hasPatterns(getProject())) {↵ | |||
5 | return true;↵ | |||
6 | }↵ | |||
7 | Enumeration e = additionalPatterns.elements();↵ | |||
8 | while (e.hasMoreElements()) {↵ | |||
9 | PatternSet ps = (PatternSet) e.nextElement()↵ | 2 | this == another) {↵ | |
3 | return true;↵ | |||
4 | }↵ | |||
5 | if (isReference()) {↵ | |||
6 | return getCheckedRef().equals(another);↵ | |||
7 | }↵ | |||
8 | if (!(another.getClass().equals(getClass()))) {↵ | |||
10 | ;↵ | 9 | return false;↵ | |
11 | ↵ | 10 | }↵ | |
12 | if (ps.hasPatterns(getProject())) {↵ | 11 | ↵ | |
13 | return true;↵ | |||
14 | }↵ | 12 | ArchiveResource r = (ArchiveResource) another;↵ | |
13 | return getArchive().equals(r.getArchive())↵ | |||
15 | }↵ | 14 | ↵ | |
16 | return false; | 15 | && getName().equals(r.getName()); | |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 6 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | PatternSet ps = (PatternSet)e.nextElement(); |
| | |||||||||||||
8 | if (ps.hasPatterns(getProject())) |
| 5 | if (!(another.getClass().equals(getClass()))) | ||||||||||||
9 | return true; |
| 6 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement PatternSet ps=(PatternSet)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Conditional return true; |
3 | Conditional return false; |