while (it.hasNext()) { BaseAssertion assertion = (BaseAssertion) it.next(); String arg = assertion.toCommand(); getProject().log("adding assertion " + arg, Project.MSG_DEBUG); commandList.add(arg); }
while (it.hasNext()) { BaseAssertion assertion = (BaseAssertion) it.next(); String arg = assertion.toCommand(); getProject().log("adding assertion " + arg, Project.MSG_DEBUG); commandIterator.add(arg); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Assertions.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Assertions.java
Method name: void applyAssertions(List) Method name: void applyAssertions(ListIterator)
Number of AST nodes: 5 Number of AST nodes: 5
1
while (it.hasNext()) {
1
while (it.hasNext()) {
2
            BaseAssertion assertion = (BaseAssertion) it.next();
2
            BaseAssertion assertion = (BaseAssertion) it.next();
3
            String arg = assertion.toCommand();
3
            String arg = assertion.toCommand();
4
            getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
4
            getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
5
            commandList.add(arg);
5
            commandIterator.add(arg);
6
        }
6
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    while (it.hasNext())
    10
    while (it.hasNext())
    11
    BaseAssertion assertion = (BaseAssertion)it.next();
    11
    BaseAssertion assertion = (BaseAssertion)it.next();
    12
    String arg = assertion.toCommand();
    12
    String arg = assertion.toCommand();
    13
    getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
    13
    getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
                                                              
    14
    commandIterator.add(arg);
    Preondition Violations
    Unmatched statement commandIterator.add(arg); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14
    commandIterator.add(arg);
    14
    commandList.add(arg);
    14
    commandList.add(arg);
    Preondition Violations
    Unmatched statement commandList.add(arg); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
    Precondition Violations (2)
    Row Violation
    1Unmatched statement commandIterator.add(arg); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement commandList.add(arg); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted