String mainjarstring = getProject().getProperty("main.jar.nonascii"); String extjarstring = getProject().getProperty("ext.jar.nonascii"); Path myPath = new Path(getProject()); myPath.setLocation(new File(mainjarstring)); getProject().setUserProperty("build.sysclasspath","ignore"); AntClassLoader myLoader = getProject().createClassLoader(myPath); String path = myLoader.getClasspath(); assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
String mainjarstring = getProject().getProperty("main.jar"); String extjarstring = getProject().getProperty("ext.jar"); Path myPath = new Path(getProject()); myPath.setLocation(new File(mainjarstring)); getProject().setUserProperty("build.sysclasspath","ignore"); AntClassLoader myLoader = getProject().createClassLoader(myPath); String path = myLoader.getClasspath(); assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
Method name: void testJarWithManifestInNonAsciiDir() Method name: void testJarWithManifestInDirWithSpace()
Number of AST nodes: 8 Number of AST nodes: 8
1
String mainjarstring = getProject().getProperty("main.jar.nonascii");
1
String mainjarstring = getProject().getProperty("main.jar");
2
        String extjarstring = getProject().getProperty("ext.jar.nonascii");
2
        String extjarstring = getProject().getProperty("ext.jar");
3
        Path myPath = new Path(getProject());
3
        Path myPath = new Path(getProject());
4
        myPath.setLocation(new File(mainjarstring));
4
        myPath.setLocation(new File(mainjarstring));
5
        getProject().setUserProperty("build.sysclasspath","ignore");
5
        getProject().setUserProperty("build.sysclasspath","ignore");
6
        AntClassLoader myLoader = getProject().createClassLoader(myPath);
6
        AntClassLoader myLoader = getProject().createClassLoader(myPath);
7
        String path = myLoader.getClasspath();
7
        String path = myLoader.getClasspath();
8
        assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
8
        assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons40
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    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 2
    Mapped Statements
    ID Statement ID Statement
    1
    String mainjarstring = getProject().getProperty("main.jar.nonascii");
    1
    String mainjarstring = getProject().getProperty("main.jar.nonascii");
    1
    String mainjarstring = getProject().getProperty("main.jar");
    Differences
    Expression1Expression2Difference
    "main.jar.nonascii""main.jar"LITERAL_VALUE_MISMATCH
    1
    String mainjarstring = getProject().getProperty("main.jar");
    2
    String extjarstring = getProject().getProperty("ext.jar.nonascii");
    2
    String extjarstring = getProject().getProperty("ext.jar.nonascii");
    2
    String extjarstring = getProject().getProperty("ext.jar");
    Differences
    Expression1Expression2Difference
    "ext.jar.nonascii""ext.jar"LITERAL_VALUE_MISMATCH
    2
    String extjarstring = getProject().getProperty("ext.jar");
    3
    Path myPath = new Path(getProject());
    3
    Path myPath = new Path(getProject());
    4
    myPath.setLocation(new File(mainjarstring));
    4
    myPath.setLocation(new File(mainjarstring));
    5
    getProject().setUserProperty("build.sysclasspath", "ignore");
    5
    getProject().setUserProperty("build.sysclasspath", "ignore");
    6
    AntClassLoader myLoader = getProject().createClassLoader(myPath);
    6
    AntClassLoader myLoader = getProject().createClassLoader(myPath);
    7
    String path = myLoader.getClasspath();
    7
    String path = myLoader.getClasspath();
    8
    assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
    8
    assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
    Precondition Violations (0)
    Row Violation