if (isReference()) {
throw noChildrenAllowed();
}
if (s == null) {
return;
}
v.add(s);
setChecked(false);
if (isReference()) {
throw noChildrenAllowed();
}
if (c == null) {
return;
}
v = (v == null) ? new Vector() : v;
v.add(c);
Clone fragments detected by clone detection tool
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/resources/comparators/DelegatedResourceComparator.java
|
Method name: void add(ResourceSelector)
|
|
Method name: void add(ResourceComparator)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (isReference()) {↵ | | 1 | if (isReference()) {↵
|
2 | throw noChildrenAllowed();↵ | | 2 | throw noChildrenAllowed();↵
|
3 | }↵ | | 3 | }↵
|
4 | if (s == null) {↵ | | 4 | if (c == null) {↵
|
5 | return;↵ | | 5 | return;↵
|
6 | }↵ | | 6 | }↵
|
7 | v.add(s);↵ | | 7 | v↵
|
8 | setChecked(false↵ | | 8 | = (v == null) ? new Vector() : v;↵
|
9 | ); | | 9 | v.add(c);
|
See real code fragment |
|
See real code fragment |
Summary
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 | 17 |
-
{Non-refactorable}
Mapping Summary
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.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (isReference()) | | 1 | if (isReference()) |
2 | throw noChildrenAllowed(); | | 2 | throw noChildrenAllowed(); |
3 | if (s == null) | | 3 | if (c == null) |
4 | | | 4 | |
| | | 5 | v = (v == null) ? new Vector() : v; |
5 | v.add(s); | | 6 | v.add(c); |
6 | setChecked(false); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Type org.apache.tools.ant.types.resources.selectors.ResourceSelector of variable s does not match with type org.apache.tools.ant.types.resources.comparators.ResourceComparator of variable c |
2 | Type org.apache.tools.ant.types.resources.selectors.ResourceSelector of variable s does not match with type org.apache.tools.ant.types.resources.comparators.ResourceComparator of variable c |