if (is != null) { InputStreamReader isr; if (manifestEncoding == null) { isr = new InputStreamReader(is); } else { isr = new InputStreamReader(is, manifestEncoding); } manifest = getManifest(isr); } else { manifest = getManifest(file); }
if (is != null) { InputStreamReader isr; if (manifestEncoding == null) { isr = new InputStreamReader(is); } else { isr = new InputStreamReader(is, manifestEncoding); } newManifest = getManifest(isr); } else { newManifest = getManifest(file); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Jar.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Jar.java
Method name: void filesetManifest(File, InputStream) Method name: void filesetManifest(File, InputStream)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (is != null) {
1
if (is != null) {
2
                    InputStreamReader isr;
2
                    InputStreamReader isr;
3
                    if (manifestEncoding == null) {
3
                    if (manifestEncoding == null) {
4
                        isr = new InputStreamReader(is);
4
                        isr = new InputStreamReader(is);
5
                    } else {
5
                    } else {
6
                        isr = new InputStreamReader(is, manifestEncoding);
6
                        isr = new InputStreamReader(is, manifestEncoding);
7
                    }
7
                    }
8
                    manifest = getManifest(isr);
8
                    newManifest = getManifest(isr);
9
                } else {
9
                } else {
10
                    manifest = getManifest(file);
10
                    newManifest = getManifest(file);
11
                }
11
                }
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.3
Clones locationClones are in the same method
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (is != null)
    15
    if (is != null)
    5
    InputStreamReader isr;
    16
    InputStreamReader isr;
    6
    if (manifestEncoding == null)
    17
    if (manifestEncoding == null)
    7
    isr = new InputStreamReader(is);
    18
    isr = new InputStreamReader(is);
    else
    else
    8
    isr = new InputStreamReader(is, manifestEncoding);
    19
    isr = new InputStreamReader(is, manifestEncoding);
    9
    manifest = getManifest(isr);
    9
    manifest = getManifest(isr);
    20
    newManifest = getManifest(isr);
    Differences
    Expression1Expression2Difference
    manifestnewManifestVARIABLE_NAME_MISMATCH
    20
    newManifest = getManifest(isr);
    else
    else
    10
    manifest = getManifest(file);
    10
    manifest = getManifest(file);
    21
    newManifest = getManifest(file);
    Differences
    Expression1Expression2Difference
    manifestnewManifestVARIABLE_NAME_MISMATCH
    21
    newManifest = getManifest(file);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables , while Clone fragment #2 returns variables newManifest