File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/selectors/ResourceSelectorContainer.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/AbstractSelectorContainer.java | |||
Method name: void dieOnCircularReference(Stack, Project)
|
Method name: void validate()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | for (Iterator i = v.iterator(); i.hasNext();) {↵ | 1 | while (e.hasMoreElements()) {↵ | |
2 | Object o = i.next();↵ | 2 | Object o = e.nextElement();↵ | |
3 | if (o instanceof DataType) {↵ | 3 | if (o instanceof BaseSelector) {↵ | |
4 | stk.push(o);↵ | 4 | ↵ | |
5 | invokeCircularReferenceCheck((DataType) o, stk, p);↵ | 5 | ((BaseSelector) o).validate();↵ | |
6 | }↵ | 6 | ↵ | |
7 | ↵ | 7 | }↵ | |
8 | } | 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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 8 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 3 | Object o = e.nextElement(); | |||||||||||||||||||||
6 | Object o = i.next(); |
| | |||||||||||||||||||||
7 | if (o instanceof DataType) |
| 4 | if (o instanceof BaseSelector) | ||||||||||||||||||||
8 | stk.push(o); | | ||||||||||||||||||||||
9 | invokeCircularReferenceCheck((DataType)o, stk, p); |
| 5 | ((BaseSelector)o).validate(); |
Row | Violation |
---|---|
1 | Unmatched statement Object o=e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Object o=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression invokeCircularReferenceCheck((DataType)o,stk,p) is a void method call, and thus it cannot be parameterized |
4 | Expression ((BaseSelector)o).validate() is a void method call, and thus it cannot be parameterized |
5 | Expression invokeCircularReferenceCheck((DataType)o,stk,p) is a void method call, and thus it cannot be parameterized |
6 | Expression ((BaseSelector)o).validate() is a void method call, and thus it cannot be parameterized |