f = (TarFileSet)getInstance(); f.setSrc(new File("example.tar")); f.setFullpath("/doc/manual/index.html");
f = (ZipFileSet)getInstance(); f.setSrc(new File("example.zip")); f.setFullpath("/doc/manual/index.html");
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/TarFileSetTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/ZipFileSetTest.java
Method name: void testAttributes() Method name: void testAttributes()
Number of AST nodes: 3 Number of AST nodes: 3
1
f = (TarFileSet)getInstance();
1
f = (ZipFileSet)getInstance();
2
        f.setSrc(new File("example.tar"));
2
        f.setSrc(new File("example.zip"));
3
        f.setFullpath("/doc/manual/index.html");
3
        f.setFullpath("/doc/manual/index.html");
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 in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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
    17
    f = (TarFileSet)getInstance();
    17
    f = (TarFileSet)getInstance();
    17
    f = (ZipFileSet)getInstance();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.TarFileSetorg.apache.tools.ant.types.ZipFileSetSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.TarFileSetorg.apache.tools.ant.types.ZipFileSetSUBCLASS_TYPE_MISMATCH
    17
    f = (ZipFileSet)getInstance();
    18
    f.setSrc(new File("example.tar"));
    18
    f.setSrc(new File("example.tar"));
    18
    f.setSrc(new File("example.zip"));
    Differences
    Expression1Expression2Difference
    "example.tar""example.zip"LITERAL_VALUE_MISMATCH
    org.apache.tools.ant.types.TarFileSetorg.apache.tools.ant.types.ZipFileSetSUBCLASS_TYPE_MISMATCH
    18
    f.setSrc(new File("example.zip"));
    19
    f.setFullpath("/doc/manual/index.html");
    19
    f.setFullpath("/doc/manual/index.html");
    19
    f.setFullpath("/doc/manual/index.html");
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.TarFileSetorg.apache.tools.ant.types.ZipFileSetSUBCLASS_TYPE_MISMATCH
    19
    f.setFullpath("/doc/manual/index.html");
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variable f with type org.apache.tools.ant.types.TarFileSet , while Clone fragment #2 returns variable f with type org.apache.tools.ant.types.ZipFileSet