getProject().log("Applying assertions", Project.MSG_DEBUG); Assertions clause = getFinalReference(); //do the system assertions if (Boolean.TRUE.equals(clause.enableSystemAssertions)) { getProject().log("Enabling system assertions", Project.MSG_DEBUG); commandList.add("-enablesystemassertions"); } else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) { getProject().log("disabling system assertions", Project.MSG_DEBUG); commandList.add("-disablesystemassertions"); } //now any inner assertions Iterator it = clause.assertionList.iterator(); while (it.hasNext()) { BaseAssertion assertion = (BaseAssertion) it.next(); String arg = assertion.toCommand(); getProject().log("adding assertion " + arg, Project.MSG_DEBUG); commandList.add(arg); }
getProject().log("Applying assertions", Project.MSG_DEBUG); Assertions clause = getFinalReference(); //do the system assertions if (Boolean.TRUE.equals(clause.enableSystemAssertions)) { getProject().log("Enabling system assertions", Project.MSG_DEBUG); commandIterator.add("-enablesystemassertions"); } else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) { getProject().log("disabling system assertions", Project.MSG_DEBUG); commandIterator.add("-disablesystemassertions"); } //now any inner assertions Iterator it = clause.assertionList.iterator(); 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: 14 Number of AST nodes: 14
1
getProject().log("Applying assertions", Project.MSG_DEBUG);
1
getProject().log("Applying assertions", Project.MSG_DEBUG);
2
        Assertions clause = getFinalReference();
2
        Assertions clause = getFinalReference();
3
        //do the system assertions
3
        //do the system assertions
4
        if (Boolean.TRUE.equals(clause.enableSystemAssertions)) {
4
        if (Boolean.TRUE.equals(clause.enableSystemAssertions)) {
5
            getProject().log("Enabling system assertions", Project.MSG_DEBUG);
5
            getProject().log("Enabling system assertions", Project.MSG_DEBUG);
6
            commandList.add("-enablesystemassertions");
6
            commandIterator.add("-enablesystemassertions");
7
        } else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) {
7
        } else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) {
8
            getProject().log("disabling system assertions", Project.MSG_DEBUG);
8
            getProject().log("disabling system assertions", Project.MSG_DEBUG);
9
            commandList.add("-disablesystemassertions");
9
            commandIterator.add("-disablesystemassertions");
10
        }
10
        }
11
        //now any inner assertions
11
        //now any inner assertions
12
        Iterator it = clause.assertionList.iterator();
12
        Iterator it = clause.assertionList.iterator();
13
        while (it.hasNext()) {
13
        while (it.hasNext()) {
14
            BaseAssertion assertion = (BaseAssertion) it.next();
14
            BaseAssertion assertion = (BaseAssertion) it.next();
15
            String arg = assertion.toCommand();
15
            String arg = assertion.toCommand();
16
            getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
16
            getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
17
            commandList.add(arg);
17
            commandIterator.add(arg);
18
        }
18
        }
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)1.1
Clones locationClones are declared in the same class
Number of node comparisons94
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)9.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    getProject().log("Applying assertions", Project.MSG_DEBUG);
    1
    getProject().log("Applying assertions", Project.MSG_DEBUG);
    2
    Assertions clause = getFinalReference();
    2
    Assertions clause = getFinalReference();
    3
    if (Boolean.TRUE.equals(clause.enableSystemAssertions))
    3
    if (Boolean.TRUE.equals(clause.enableSystemAssertions))
    4
    getProject().log("Enabling system assertions", Project.MSG_DEBUG);
    4
    getProject().log("Enabling system assertions", Project.MSG_DEBUG);
                                                                                                        
    5
    commandIterator.add("-enablesystemassertions");
    5
    commandList.add("-enablesystemassertions");
                                                                                                
    6
    else if (Boolean.FALSE.equals(clause.enableSystemAssertions))
    6
    else if (Boolean.FALSE.equals(clause.enableSystemAssertions))
    7
    getProject().log("disabling system assertions", Project.MSG_DEBUG);
    7
    getProject().log("disabling system assertions", Project.MSG_DEBUG);
                                                                                                          
    8
    commandIterator.add("-disablesystemassertions");
    8
    commandList.add("-disablesystemassertions");
                                                                                                  
    9
    Iterator it = clause.assertionList.iterator();
    9
    Iterator it = clause.assertionList.iterator();
    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