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); }
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); }
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 != implementationVendor) {
1
if (null != specificationVendor) {
2
            attributes.putValue(prefix + IMPLEMENTATION_VENDOR,
2
            attributes.putValue(prefix + SPECIFICATION_VENDOR,
3
                                 implementationVendor);
3
                                 specificationVendor);
4
        }
4
        }
5
        final DeweyDecimal implementationVersion
5
        final DeweyDecimal specificationVersion
6
            = extension.getImplementationVersion();
6
            = extension.getSpecificationVersion();
7
        if (null != implementationVersion) {
7
        if (null != specificationVersion) {
8
            attributes.putValue(prefix + IMPLEMENTATION_VERSION,
8
            attributes.putValue(prefix + SPECIFICATION_VERSION,
9
                                 implementationVersion.toString());
9
                                 specificationVersion.toString());
10
        }
10
        }
11
        final String implementationURL
11
        final String implementationVendorID
12
 = extension.getImplementationURL();
12
            = extension.getImplementationVendorID();
13
        if (null != implementationURL) {
13
        if (null != implementationVendorID) {
14
            attributes.putValue(prefix + IMPLEMENTATION_URL,
14
            attributes.putValue(prefix + IMPLEMENTATION_VENDOR_ID,
15
                                 implementationURL);
15
                                 implementationVendorID);
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.5
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)4.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (null != implementationVendor)
    12
    if (null != implementationVendor)
    3
    if (null != specificationVendor)
    Differences
    Expression1Expression2Difference
    implementationVendorspecificationVendorVARIABLE_NAME_MISMATCH
    3
    if (null != specificationVendor)
    13
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR, implementationVendor);
    13
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR, implementationVendor);
    4
    attributes.putValue(prefix + SPECIFICATION_VENDOR, specificationVendor);
    Differences
    Expression1Expression2Difference
    IMPLEMENTATION_VENDORSPECIFICATION_VENDORVARIABLE_NAME_MISMATCH
    implementationVendorspecificationVendorVARIABLE_NAME_MISMATCH
    4
    attributes.putValue(prefix + SPECIFICATION_VENDOR, specificationVendor);
    14
    final DeweyDecimal implementationVersion = extension.getImplementationVersion();
    14
    final DeweyDecimal implementationVersion = extension.getImplementationVersion();
    5
    final DeweyDecimal specificationVersion = extension.getSpecificationVersion();
    Differences
    Expression1Expression2Difference
    implementationVersionspecificationVersionVARIABLE_NAME_MISMATCH
    getImplementationVersiongetSpecificationVersionMETHOD_INVOCATION_NAME_MISMATCH
    5
    final DeweyDecimal specificationVersion = extension.getSpecificationVersion();
    15
    if (null != implementationVersion)
    15
    if (null != implementationVersion)
    6
    if (null != specificationVersion)
    Differences
    Expression1Expression2Difference
    implementationVersionspecificationVersionVARIABLE_NAME_MISMATCH
    6
    if (null != specificationVersion)
    16
    attributes.putValue(prefix + IMPLEMENTATION_VERSION, implementationVersion.toString());
    16
    attributes.putValue(prefix + IMPLEMENTATION_VERSION, implementationVersion.toString());
    7
    attributes.putValue(prefix + SPECIFICATION_VERSION, specificationVersion.toString());
    Differences
    Expression1Expression2Difference
    IMPLEMENTATION_VERSIONSPECIFICATION_VERSIONVARIABLE_NAME_MISMATCH
    implementationVersionspecificationVersionVARIABLE_NAME_MISMATCH
    7
    attributes.putValue(prefix + SPECIFICATION_VERSION, specificationVersion.toString());
    17
    final String implementationURL = extension.getImplementationURL();
    17
    final String implementationURL = extension.getImplementationURL();
    8
    final String implementationVendorID = extension.getImplementationVendorID();
    Differences
    Expression1Expression2Difference
    implementationURLimplementationVendorIDVARIABLE_NAME_MISMATCH
    getImplementationURLgetImplementationVendorIDMETHOD_INVOCATION_NAME_MISMATCH
    8
    final String implementationVendorID = extension.getImplementationVendorID();
    18
    if (null != implementationURL)
    18
    if (null != implementationURL)
    9
    if (null != implementationVendorID)
    Differences
    Expression1Expression2Difference
    implementationURLimplementationVendorIDVARIABLE_NAME_MISMATCH
    9
    if (null != implementationVendorID)
    19
    attributes.putValue(prefix + IMPLEMENTATION_URL, implementationURL);
    19
    attributes.putValue(prefix + IMPLEMENTATION_URL, implementationURL);
    10
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR_ID, implementationVendorID);
    Differences
    Expression1Expression2Difference
    IMPLEMENTATION_URLIMPLEMENTATION_VENDOR_IDVARIABLE_NAME_MISMATCH
    implementationURLimplementationVendorIDVARIABLE_NAME_MISMATCH
    10
    attributes.putValue(prefix + IMPLEMENTATION_VENDOR_ID, implementationVendorID);
    Precondition Violations (0)
    Row Violation