ConcatFilter newFilter = new ConcatFilter(rdr);
newFilter.setPrepend(getPrepend());
newFilter.setAppend(getAppend());
// Usually the initialized is set to true. But here it must not.
// Because the prepend and append readers have to be instantiated
// on runtime
//newFilter.setInitialized(true);
return newFilter;
LineContains newFilter = new LineContains(rdr);
newFilter.setContains(getContains());
newFilter.setNegate(isNegated());
return newFilter;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/ConcatFilter.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/LineContains.java
|
Method name: Reader chain(Reader)
|
|
Method name: Reader chain(Reader)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | ConcatFilter newFilter = new ConcatFilter(rdr);↵ | | 1 | LineContains newFilter = new LineContains(rdr);↵
|
2 | newFilter.setPrepend(getPrepend());↵ | | 2 | newFilter.setContains(getContains());↵
|
3 | newFilter.setAppend(getAppend());↵ | | 3 | newFilter.set↵
|
4 | // Usually the initialized is set to true. But here it must not.↵ | | |
|
5 | // Because the prepend and append readers have to be instantiated↵ | | |
|
6 | // on runtime↵ | | |
|
7 | //newFilter.setInitialized(true);↵ | | 4 | Negate(isNegated());↵
|
8 | return newFilter; | | 5 | return newFilter;
|
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | ConcatFilter newFilter = new ConcatFilter(rdr); | | 1 | LineContains newFilter = new LineContains(rdr); |
| | | 2 | newFilter.setContains(getContains()); |
2 | newFilter.setPrepend(getPrepend()); | | | |
| | | 3 | newFilter.setNegate(isNegated()); |
3 | newFilter.setAppend(getAppend()); | | | |
4 | return newFilter; | | 4 | return newFilter; |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variable newFilter with type org.apache.tools.ant.filters.ConcatFilter , while Clone fragment #2 returns variable newFilter with type org.apache.tools.ant.filters.LineContains |