if (null != specificationVendor) { attributes.putValue(prefix + SPECIFICATION_VENDOR, specificationVendor); } final DeweyDecimal specificationVersion = extension.getSpecificationVersion(); if (null != specificationVersion) { attributes.putValue(prefix + SPECIFICATION_VERSION, specificationVersion.toString()); } final String implementationVendorID = extension.getImplementationVendorID(); if (null != implementationVendorID) { attributes.putValue(prefix + IMPLEMENTATION_VENDOR_ID, implementationVendorID); }
if (null != implementationVendor) { attributes.putValue(prefix + IMPLEMENTATION_VENDOR, implementationVendor); } final DeweyDecimal implementationVersion = extension.getImplementationVersion(); if (null != implementationVersion) { attributes.putValue(prefix + IMPLEMENTATION_VERSION, implementationVersion.toString()); } final String implementationURL = extension.getImplementationURL(); if (null != implementationURL) { attributes.putValue(prefix + IMPLEMENTATION_URL, implementationURL); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Extension.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Extension.java
Method name: void addExtension(Extension, String, Attributes) Method name: void addExtension(Extension, String, Attributes)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (null != specificationVendor) {
1
if (null != implementationVendor) {
2
            attributes.putValue(prefix + SPECIFICATION_VENDOR,
2
            attributes.putValue(prefix + IMPLEMENTATION_VENDOR,
3
                                 specificationVendor);
3
                                 implementationVendor);
4
        }
4
        }
5
        final DeweyDecimal specificationVersion
5
        final DeweyDecimal implementationVersion
6
            = extension.getSpecificationVersion();
6
            = extension.getImplementationVersion();
7
        if (null != specificationVersion) {
7
        if (null != implementationVersion) {
8
            attributes.putValue(prefix + SPECIFICATION_VERSION,
8
            attributes.putValue(prefix + IMPLEMENTATION_VERSION,
9
                                 specificationVersion.toString());
9
                                 implementationVersion.toString());
10
        }
10
        }
11
        final String implementationVendorID
11
        final String implementation
12
            = extension.getImplementationVendorID();
12
URL = extension.getImplementationURL();
13
        if (null != implementationVendorID) {
13
        if (null != implementationURL) {
14
            attributes.putValue(prefix + IMPLEMENTATION_VENDOR_ID,
14
            attributes.putValue(prefix + IMPLEMENTATION_URL,
15
                                 implementationVendorID);
15
                                 implementationURL);
16
        }
16
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in the same method
Number of node comparisons31
  1. {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)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (null != specificationVendor)
    3
    if (null != specificationVendor)
    12
    if (null != implementationVendor)
    Differences
    Expression1Expression2Difference
    specificationVendorimplementationVendorVARIABLE_NAME_MISMATCH
    12
    if (null != implementationVendor)
    4
    attributes.putValue(prefix + SPECIFICATION_VENDOR, specificationVendor);
    4
    attributes.putValue(prefix + SPECIFICATION_VENDOR, specificationVendor);
    13
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR, implementationVendor);
    Differences
    Expression1Expression2Difference
    SPECIFICATION_VENDORIMPLEMENTATION_VENDORVARIABLE_NAME_MISMATCH
    specificationVendorimplementationVendorVARIABLE_NAME_MISMATCH
    13
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR, implementationVendor);
    5
    final DeweyDecimal specificationVersion = extension.getSpecificationVersion();
    5
    final DeweyDecimal specificationVersion = extension.getSpecificationVersion();
    14
    final DeweyDecimal implementationVersion = extension.getImplementationVersion();
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    getSpecificationVersiongetImplementationVersionMETHOD_INVOCATION_NAME_MISMATCH
    14
    final DeweyDecimal implementationVersion = extension.getImplementationVersion();
    6
    if (null != specificationVersion)
    6
    if (null != specificationVersion)
    15
    if (null != implementationVersion)
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    15
    if (null != implementationVersion)
    7
    attributes.putValue(prefix + SPECIFICATION_VERSION, specificationVersion.toString());
    7
    attributes.putValue(prefix + SPECIFICATION_VERSION, specificationVersion.toString());
    16
    attributes.putValue(prefix + IMPLEMENTATION_VERSION, implementationVersion.toString());
    Differences
    Expression1Expression2Difference
    SPECIFICATION_VERSIONIMPLEMENTATION_VERSIONVARIABLE_NAME_MISMATCH
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    16
    attributes.putValue(prefix + IMPLEMENTATION_VERSION, implementationVersion.toString());
    8
    final String implementationVendorID = extension.getImplementationVendorID();
    8
    final String implementationVendorID = extension.getImplementationVendorID();
    17
    final String implementationURL = extension.getImplementationURL();
    Differences
    Expression1Expression2Difference
    implementationVendorIDimplementationURLVARIABLE_NAME_MISMATCH
    getImplementationVendorIDgetImplementationURLMETHOD_INVOCATION_NAME_MISMATCH
    17
    final String implementationURL = extension.getImplementationURL();
    9
    if (null != implementationVendorID)
    9
    if (null != implementationVendorID)
    18
    if (null != implementationURL)
    Differences
    Expression1Expression2Difference
    implementationVendorIDimplementationURLVARIABLE_NAME_MISMATCH
    18
    if (null != implementationURL)
    10
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR_ID, implementationVendorID);
    10
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR_ID, implementationVendorID);
    19
    attributes.putValue(prefix + IMPLEMENTATION_URL, implementationURL);
    Differences
    Expression1Expression2Difference
    IMPLEMENTATION_VENDOR_IDIMPLEMENTATION_URLVARIABLE_NAME_MISMATCH
    implementationVendorIDimplementationURLVARIABLE_NAME_MISMATCH
    19
    attributes.putValue(prefix + IMPLEMENTATION_URL, implementationURL);
    Precondition Violations (0)
    Row Violation