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 (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: 8 Number of AST nodes: 8
1
if (specificationTitle == null) {
1
if (implementationTitle == null) {
2
                specificationTitle
2
                implementationTitle
3
                    = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
3
                    = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
4
            }
4
            }
5
            if (specificationVendor == null) {
5
            if (implementationVendor == null) {
6
                specificationVendor
6
                implementationVendor
7
                    = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
7
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
8
            }
8
            }
9
            if (specificationVersion == null) {
9
            if (implementationVersion == null) {
10
                specificationVersion
10
                implementationVersion
11
                    = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
11
                    = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
12
            }
12
            }
13
            if (implementationTitle == null) {
13
            if (sealedString == null) {
14
                implementationTitle
14
                sealedString
15
                    = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
15
                    = mainAttributes.getValue(Name.SEALED);
16
            }
16
            }
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.8
Clones locationClones are in the same method
Number of node comparisons47
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    if (specificationTitle == null)
    21
    if (specificationTitle == null)
    27
    if (implementationTitle == null)
    Differences
    Expression1Expression2Difference
    specificationTitleimplementationTitleVARIABLE_NAME_MISMATCH
    27
    if (implementationTitle == null)
    22
    specificationTitle = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
    22
    specificationTitle = mainAttributes.getValue(Name.SPECIFICATION_TITLE);
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    Differences
    Expression1Expression2Difference
    specificationTitleimplementationTitleVARIABLE_NAME_MISMATCH
    SPECIFICATION_TITLEIMPLEMENTATION_TITLEVARIABLE_NAME_MISMATCH
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    23
    if (specificationVendor == null)
    23
    if (specificationVendor == null)
    29
    if (implementationVendor == null)
    Differences
    Expression1Expression2Difference
    specificationVendorimplementationVendorVARIABLE_NAME_MISMATCH
    29
    if (implementationVendor == null)
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    24
    specificationVendor = mainAttributes.getValue(Name.SPECIFICATION_VENDOR);
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    Differences
    Expression1Expression2Difference
    specificationVendorimplementationVendorVARIABLE_NAME_MISMATCH
    SPECIFICATION_VENDORIMPLEMENTATION_VENDORVARIABLE_NAME_MISMATCH
    30
    implementationVendor = mainAttributes.getValue(Name.IMPLEMENTATION_VENDOR);
    25
    if (specificationVersion == null)
    25
    if (specificationVersion == null)
    31
    if (implementationVersion == null)
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    31
    if (implementationVersion == null)
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    26
    specificationVersion = mainAttributes.getValue(Name.SPECIFICATION_VERSION);
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    SPECIFICATION_VERSIONIMPLEMENTATION_VERSIONVARIABLE_NAME_MISMATCH
    32
    implementationVersion = mainAttributes.getValue(Name.IMPLEMENTATION_VERSION);
    27
    if (implementationTitle == null)
    27
    if (implementationTitle == null)
    33
    if (sealedString == null)
    Differences
    Expression1Expression2Difference
    implementationTitlesealedStringVARIABLE_NAME_MISMATCH
    33
    if (sealedString == null)
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    28
    implementationTitle = mainAttributes.getValue(Name.IMPLEMENTATION_TITLE);
    34
    sealedString = mainAttributes.getValue(Name.SEALED);
    Differences
    Expression1Expression2Difference
    implementationTitlesealedStringVARIABLE_NAME_MISMATCH
    IMPLEMENTATION_TITLESEALEDVARIABLE_NAME_MISMATCH
    34
    sealedString = mainAttributes.getValue(Name.SEALED);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables specificationTitle, specificationVendor, specificationVersion, implementationTitle , while Clone fragment #2 returns variables sealedString, implementationTitle, implementationVendor, implementationVersion