if (isReference()) {
throw noChildrenAllowed();
}
PathElement pe = new PathElement();
add(pe);
return pe;
if (isReference()) {
throw noChildrenAllowed();
}
Path result = new Path(getProject());
add(result);
return result;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Path.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/PathConvert.java
|
Method name: PathElement createPathElement()
|
|
Method name: Path createPath()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (isReference()) {↵ | | 1 | if (isReference()) {↵
|
2 | throw noChildrenAllowed();↵ | | 2 | throw noChildrenAllowed();↵
|
3 | }↵ | | 3 | }↵
|
4 | PathElement pe = new PathElement();↵ | | 4 | Path result = new Path(getProject());↵
|
5 | add(pe);↵ | | 5 | add(result);↵
|
6 | return pe; | | 6 | return result;
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (isReference()) | | 1 | if (isReference()) |
2 | throw noChildrenAllowed(); | | 2 | throw noChildrenAllowed(); |
| | | 3 | Path result = new Path(getProject()); |
3 | PathElement pe = new PathElement(); | | | |
4 | add(pe); | | 4 | add(result); |
| | | 5 | return result; |
5 | return pe; | | | |
Precondition Violations (3)
Row |
Violation |
1 | Type org.apache.tools.ant.types.Path.PathElement of variable pe does not match with type org.apache.tools.ant.types.Path of variable result |
2 | Unmatched return result; |
3 | Unmatched return pe; |