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); }
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); }
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
                    newManifest = getManifest(isr);
8
                    manifest = getManifest(isr);
9
                } else {
9
                } else {
10
                    newManifest = getManifest(file);
10
                    manifest = 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.2
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
    15
    if (is != null)
    4
    if (is != null)
    16
    InputStreamReader isr;
    5
    InputStreamReader isr;
    17
    if (manifestEncoding == null)
    6
    if (manifestEncoding == null)
    18
    isr = new InputStreamReader(is);
    7
    isr = new InputStreamReader(is);
    else
    else
    19
    isr = new InputStreamReader(is, manifestEncoding);
    8
    isr = new InputStreamReader(is, manifestEncoding);
    20
    newManifest = getManifest(isr);
    20
    newManifest = getManifest(isr);
    9
    manifest = getManifest(isr);
    Differences
    Expression1Expression2Difference
    newManifestmanifestVARIABLE_NAME_MISMATCH
    9
    manifest = getManifest(isr);
    else
    else
    21
    newManifest = getManifest(file);
    21
    newManifest = getManifest(file);
    10
    manifest = getManifest(file);
    Differences
    Expression1Expression2Difference
    newManifestmanifestVARIABLE_NAME_MISMATCH
    10
    manifest = getManifest(file);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables newManifest , while Clone fragment #2 returns variables