String buildTestcases = System.getProperty("build.tests"); assertNotNull("defined ${build.tests}", buildTestcases); assertTrue("have a dir " + buildTestcases, new File(buildTestcases).isDirectory()); Path path = new Path(p, buildTestcases + "/org"); // A special parent loader which is not the system class loader: ClassLoader parent = new ParentLoader();
String buildTestcases = System.getProperty("build.tests"); assertNotNull("defined ${build.tests}", buildTestcases); assertTrue("have a dir " + buildTestcases, new File(buildTestcases).isDirectory()); Path path = new Path(p, buildTestcases + "/org"); // A special parent loader which is not the system class loader: ClassLoader parent = new ParentLoader();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest.java
Method name: void testFindResources() Method name: void testFindIsolateResources()
Number of AST nodes: 5 Number of AST nodes: 5
1
String buildTestcases = System.getProperty("build.tests");
1
String buildTestcases = System.getProperty("build.tests");
2
        assertNotNull("defined ${build.tests}", buildTestcases);
2
        assertNotNull("defined ${build.tests}", buildTestcases);
3
        assertTrue("have a dir " + buildTestcases,
3
        assertTrue("have a dir " + buildTestcases,
4
                   new File(buildTestcases).isDirectory());
4
                   new File(buildTestcases).isDirectory());
5
        Path path = new Path(p, buildTestcases + "/org");
5
        Path path = new Path(p, buildTestcases + "/org");
6
        // A special parent loader which is not the system class loader:
6
        // A special parent loader which is not the system class loader:
7
        ClassLoader parent = new ParentLoader();
7
        ClassLoader parent = new ParentLoader();
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.0
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    String buildTestcases = System.getProperty("build.tests");
    1
    String buildTestcases = System.getProperty("build.tests");
    2
    assertNotNull("defined ${build.tests}", buildTestcases);
    2
    assertNotNull("defined ${build.tests}", buildTestcases);
    3
    assertTrue("have a dir " + buildTestcases, new File(buildTestcases).isDirectory());
    3
    assertTrue("have a dir " + buildTestcases, new File(buildTestcases).isDirectory());
    4
    Path path = new Path(p, buildTestcases + "/org");
    4
    Path path = new Path(p, buildTestcases + "/org");
    5
    ClassLoader parent = new ParentLoader();
    5
    ClassLoader parent = new ParentLoader();
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables path, parent, buildTestcases , while Clone fragment #2 returns variables buildTestcases, path, parent