ForkedTestConfiguration c = new ForkedTestConfiguration(test); List l = (List) testConfigurations.get(c); if (l == null) { l = new ArrayList(); testConfigurations.put(c, l); } l.add(test);
List list = (List) prefixMapping.get(prefix); if (list == null) { list = new ArrayList(); prefixMapping.put(prefix, list); } list.add(uri);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/helper/AntXMLContext.java
Method name: Collection executeOrQueue(Enumeration, boolean) Method name: void startPrefixMapping(String, String)
Number of AST nodes: 6 Number of AST nodes: 5
1
ForkedTestConfiguration c =
2
                        new ForkedTestConfiguration(test);
3
                    List l = (List) testConfigurations.get(c);
1
List list = (List) 
4
            
2
prefixMapping.get(prefix);
5
        if (l == null) {
3
        if (list == null) {
6
                        l = new ArrayList();
4
            list = new ArrayList();
7
                        testConfigurations.put(c, l);
5
            
8
     
6
prefixMapping.put(prefix, list);
9
               }
7
        }
10
                    l.add(test);
8
        list.add(uri);
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 in different classes
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    7
    ForkedTestConfiguration c = new ForkedTestConfiguration(test);
    7
    ForkedTestConfiguration c = new ForkedTestConfiguration(test);
    Preondition Violations
    Unmatched statement ForkedTestConfiguration c=new ForkedTestConfiguration(test); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                  
    8
    List l = (List)testConfigurations.get(c);
    8
    List l = (List)testConfigurations.get(c);
    1
    List list = (List)prefixMapping.get(prefix);
    Differences
    Expression1Expression2Difference
    llistVARIABLE_NAME_MISMATCH
    cprefixVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfigurationjava.lang.StringVARIABLE_TYPE_MISMATCH
    testConfigurationsprefixMappingVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration of variable c does not match with type java.lang.String of variable prefix
    • Make classes org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration and java.lang.String extend a common superclass
    1
    List list = (List)prefixMapping.get(prefix);
    9
    if (l == null)
    9
    if (l == null)
    2
    if (list == null)
    Differences
    Expression1Expression2Difference
    llistVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression list cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    if (list == null)
    10
    l = new ArrayList();
    10
    l = new ArrayList();
    3
    list = new ArrayList();
    Differences
    Expression1Expression2Difference
    llistVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression list cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    list = new ArrayList();
    11
    testConfigurations.put(c, l);
    11
    testConfigurations.put(c, l);
    4
    prefixMapping.put(prefix, list);
    Differences
    Expression1Expression2Difference
    cprefixVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfigurationjava.lang.StringVARIABLE_TYPE_MISMATCH
    testConfigurationsprefixMappingVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration of variable c does not match with type java.lang.String of variable prefix
    • Make classes org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration and java.lang.String extend a common superclass
    4
    prefixMapping.put(prefix, list);
    12
    l.add(test);
    12
    l.add(test);
    5
    list.add(uri);
    Differences
    Expression1Expression2Difference
    testuriVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.junit.JUnitTestjava.lang.StringVARIABLE_TYPE_MISMATCH
    llistVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.optional.junit.JUnitTest of variable test does not match with type java.lang.String of variable uri
    • Make classes org.apache.tools.ant.taskdefs.optional.junit.JUnitTest and java.lang.String extend a common superclass
    Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression list cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    list.add(uri);
    Precondition Violations (11)
    Row Violation
    1Unmatched statement ForkedTestConfiguration c=new ForkedTestConfiguration(test); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration of variable c does not match with type java.lang.String of variable prefix
    4Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression list cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression list cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.ForkedTestConfiguration of variable c does not match with type java.lang.String of variable prefix
    9Type org.apache.tools.ant.taskdefs.optional.junit.JUnitTest of variable test does not match with type java.lang.String of variable uri
    10Expression l cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression list cannot be parameterized, because it has dependencies to/from statements that will be extracted