if (implementationVendor == null) { implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR); } if (implementationVersion == null) { implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION); } if (sealedString == null) { sealedString = mainAttributes.getValue(Name.SEALED); }
if (specificationTitle == null) { specificationTitle = mainAttributes.getValue(Name.SPECIFICATION_TITLE); } if (specificationVendor == null) { specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR); } if (specificationVersion == null) { specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/AntClassLoader.java
Method name: void definePackage(File, String, Manifest) Method name: void definePackage(File, String, Manifest)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (implementationVendor == null) {
1
if (specificationTitle == null) {
2
                implementationVendor
2
                specificationTitle
3
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
3
                    = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
4
            }
4
            }
5
            if (implementationVersion == null) {
5
            if (specificationVendor == null) {
6
                implementationVersion
6
                specificationVendor
7
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
7
                    = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
8
            }
8
            }
9
            if (sealedString == null) {
9
            if (specificationVersion == null) {
10
                sealedString
10
                specificationVersion
11
                    = mainAttributes.getValue(Name.SEALED);
11
                    = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
12
            }
12
            }
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.7
Clones locationClones are in the same method
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    29
    if (implementationVendor == null)
    29
    if (implementationVendor == null)
    25
    if (specificationVersion == null)
    Differences
    Expression1Expression2Difference
    implementationVendorspecificationVersionVARIABLE_NAME_MISMATCH
    25
    if (specificationVersion == null)
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    Differences
    Expression1Expression2Difference
    implementationVendorspecificationVersionVARIABLE_NAME_MISMATCH
    IMPLEMENTATION_VENDORSPECIFICATION_VERSIONVARIABLE_NAME_MISMATCH
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    31
    if (implementationVersion == null)
    31
    if (implementationVersion == null)
    23
    if (specificationVendor == null)
    Differences
    Expression1Expression2Difference
    implementationVersionspecificationVendorVARIABLE_NAME_MISMATCH
    23
    if (specificationVendor == null)
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    Differences
    Expression1Expression2Difference
    implementationVersionspecificationVendorVARIABLE_NAME_MISMATCH
    IMPLEMENTATION_VERSIONSPECIFICATION_VENDORVARIABLE_NAME_MISMATCH
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    33
    if (sealedString == null)
    33
    if (sealedString == null)
    21
    if (specificationTitle == null)
    Differences
    Expression1Expression2Difference
    sealedStringspecificationTitleVARIABLE_NAME_MISMATCH
    21
    if (specificationTitle == null)
    34
    sealedString = mainAttributes.getValue(Name.SEALED);
    34
    sealedString = mainAttributes.getValue(Name.SEALED);
    22
    specificationTitle = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
    Differences
    Expression1Expression2Difference
    sealedStringspecificationTitleVARIABLE_NAME_MISMATCH
    SEALEDSPECIFICATION_TITLEVARIABLE_NAME_MISMATCH
    22
    specificationTitle = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables sealedString, implementationVendor, implementationVersion , while Clone fragment #2 returns variables specificationTitle, specificationVendor, specificationVersion