if (null == specVendor) { throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0); } final String specVersion = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION)); if (null == specVersion) { throw new ParseException(MISSING + SPECIFICATION_VERSION, 0); }
if (null == impVersion) { throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0); } final String impVendor = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR)); if (null == impVendor) { throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Specification.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/Specification.java
Method name: Specification getSpecification(String, Attributes) Method name: Specification getSpecification(String, Attributes)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (null == specVendor) {
1
if (null == impVersion) {
2
            throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0);
2
            throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);
3
        }
3
        }
4
        final String specVersion
4
        final String impVendor
5
            = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION));
5
            = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR));
6
        if (null == specVersion) {
6
        if (null == impVendor) {
7
            throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);
7
            throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0);
8
        }
8
        }
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 comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (null == specVendor)
    5
    if (null == specVendor)
    14
    if (null == impVersion)
    Differences
    Expression1Expression2Difference
    specVendorimpVersionVARIABLE_NAME_MISMATCH
    14
    if (null == impVersion)
    6
    throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0);
    6
    throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0);
    15
    throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);
    Differences
    Expression1Expression2Difference
    SPECIFICATION_VENDORIMPLEMENTATION_VERSIONVARIABLE_NAME_MISMATCH
    15
    throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);
    7
    final String specVersion = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION));
    7
    final String specVersion = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION));
    16
    final String impVendor = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR));
    Differences
    Expression1Expression2Difference
    specVersionimpVendorVARIABLE_NAME_MISMATCH
    SPECIFICATION_VERSIONIMPLEMENTATION_VENDORVARIABLE_NAME_MISMATCH
    16
    final String impVendor = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR));
    8
    if (null == specVersion)
    8
    if (null == specVersion)
    17
    if (null == impVendor)
    Differences
    Expression1Expression2Difference
    specVersionimpVendorVARIABLE_NAME_MISMATCH
    17
    if (null == impVendor)
    9
    throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);
    9
    throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);
    18
    throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0);
    Differences
    Expression1Expression2Difference
    SPECIFICATION_VERSIONIMPLEMENTATION_VENDORVARIABLE_NAME_MISMATCH
    18
    throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0);
    Precondition Violations (0)
    Row Violation