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); } if (implementationTitle == null) { implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE); } if (implementationVendor == null) { implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR); } if (implementationVersion == null) { implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION); }
if (specificationVendor == null) { specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR); } if (specificationVersion == null) { specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION); } if (implementationTitle == null) { implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE); } 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); }
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: 12 Number of AST nodes: 12
1
if (specificationTitle == null) {
2
                specificationTitle
3
                    = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
4
            }
5
            if (specificationVendor == null) {
1
if (specificationVendor == null) {
6
                specificationVendor
2
                specificationVendor
7
                    = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
3
                    = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
8
            }
4
            }
9
            if (specificationVersion == null) {
5
            if (specificationVersion == null) {
10
                specificationVersion
6
                specificationVersion
11
                    = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
7
                    = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
12
            }
8
            }
13
            if (implementationTitle == null) {
9
            if (implementationTitle == null) {
14
                implementationTitle
10
                implementationTitle
15
                    = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
11
                    = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
16
            }
12
            }
17
            if (implementationVendor == null) {
13
            if (implementationVendor == null) {
18
                implementationVendor
14
                implementationVendor
19
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
15
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
20
            }
16
            }
21
            if (implementationVersion == null) {
17
            if (implementationVersion == null) {
22
                implementationVersion
18
                implementationVersion
23
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
19
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
24
            }
20
            }
21
            if (sealedString == null) {
22
                sealedString
23
                    = mainAttributes.getValue(Name.SEALED);
24
            }
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)1.6
Clones locationClones are in the same method
Number of node comparisons100
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    if (specificationTitle == null)
    21
    if (specificationTitle == null)
    23
    if (specificationVendor == null)
    Differences
    Expression1Expression2Difference
    specificationTitlespecificationVendorVARIABLE_NAME_MISMATCH
    23
    if (specificationVendor == null)
    22
    specificationTitle = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
    22
    specificationTitle = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    Differences
    Expression1Expression2Difference
    specificationTitlespecificationVendorVARIABLE_NAME_MISMATCH
    SPECIFICATION_TITLESPECIFICATION_VENDORVARIABLE_NAME_MISMATCH
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    23
    if (specificationVendor == null)
    23
    if (specificationVendor == null)
    25
    if (specificationVersion == null)
    Differences
    Expression1Expression2Difference
    specificationVendorspecificationVersionVARIABLE_NAME_MISMATCH
    25
    if (specificationVersion == null)
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    Differences
    Expression1Expression2Difference
    specificationVendorspecificationVersionVARIABLE_NAME_MISMATCH
    SPECIFICATION_VENDORSPECIFICATION_VERSIONVARIABLE_NAME_MISMATCH
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    25
    if (specificationVersion == null)
    25
    if (specificationVersion == null)
    27
    if (implementationTitle == null)
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationTitleVARIABLE_NAME_MISMATCH
    27
    if (implementationTitle == null)
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationTitleVARIABLE_NAME_MISMATCH
    SPECIFICATION_VERSIONIMPLEMENTATION_TITLEVARIABLE_NAME_MISMATCH
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    27
    if (implementationTitle == null)
    27
    if (implementationTitle == null)
    29
    if (implementationVendor == null)
    Differences
    Expression1Expression2Difference
    implementationTitleimplementationVendorVARIABLE_NAME_MISMATCH
    29
    if (implementationVendor == null)
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    Differences
    Expression1Expression2Difference
    implementationTitleimplementationVendorVARIABLE_NAME_MISMATCH
    IMPLEMENTATION_TITLEIMPLEMENTATION_VENDORVARIABLE_NAME_MISMATCH
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    29
    if (implementationVendor == null)
    29
    if (implementationVendor == null)
    31
    if (implementationVersion == null)
    Differences
    Expression1Expression2Difference
    implementationVendorimplementationVersionVARIABLE_NAME_MISMATCH
    31
    if (implementationVersion == null)
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    Differences
    Expression1Expression2Difference
    implementationVendorimplementationVersionVARIABLE_NAME_MISMATCH
    IMPLEMENTATION_VENDORIMPLEMENTATION_VERSIONVARIABLE_NAME_MISMATCH
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    31
    if (implementationVersion == null)
    31
    if (implementationVersion == null)
    33
    if (sealedString == null)
    Differences
    Expression1Expression2Difference
    implementationVersionsealedStringVARIABLE_NAME_MISMATCH
    33
    if (sealedString == null)
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    34
    sealedString = mainAttributes.getValue(Name.SEALED);
    Differences
    Expression1Expression2Difference
    implementationVersionsealedStringVARIABLE_NAME_MISMATCH
    IMPLEMENTATION_VERSIONSEALEDVARIABLE_NAME_MISMATCH
    34
    sealedString = mainAttributes.getValue(Name.SEALED);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables specificationTitle, specificationVendor, specificationVersion, implementationTitle, implementationVendor, implementationVersion , while Clone fragment #2 returns variables sealedString, specificationVendor, specificationVersion, implementationTitle, implementationVendor, implementationVersion