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); } final String impTitle = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE)); if (null == impTitle) { throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0); }
if (null == impTitle) { throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0); } final String impVersion = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION)); 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: 8 Number of AST nodes: 8
1
if (null == specVendor) {
1
if (null == impTitle) {
2
            throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0);
2
            throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);
3
        }
3
        }
4
        final String specVersion
4
        final String impVersion
5
            = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION));
5
            = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION));
6
        if (null == specVersion) {
6
        if (null == impVersion) {
7
            throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);
7
            throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);
8
        }
8
        }
9
        final String impTitle
9
        final String impVendor
10
            = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE));
10
            = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR));
11
        if (null == impTitle) {
11
        if (null == impVendor) {
12
            throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);
12
            throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0);
13
        }
13
        }
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.4
Clones locationClones are in the same method
Number of node comparisons31
  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)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (null == specVendor)
    5
    if (null == specVendor)
    11
    if (null == impTitle)
    Differences
    Expression1Expression2Difference
    specVendorimpTitleVARIABLE_NAME_MISMATCH
    11
    if (null == impTitle)
    6
    throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0);
    6
    throw new ParseException(MISSING + SPECIFICATION_VENDOR, 0);
    12
    throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);
    Differences
    Expression1Expression2Difference
    SPECIFICATION_VENDORIMPLEMENTATION_TITLEVARIABLE_NAME_MISMATCH
    12
    throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);
    7
    final String specVersion = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION));
    7
    final String specVersion = getTrimmedString(attributes.getValue(SPECIFICATION_VERSION));
    13
    final String impVersion = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION));
    Differences
    Expression1Expression2Difference
    specVersionimpVersionVARIABLE_NAME_MISMATCH
    SPECIFICATION_VERSIONIMPLEMENTATION_VERSIONVARIABLE_NAME_MISMATCH
    13
    final String impVersion = getTrimmedString(attributes.getValue(IMPLEMENTATION_VERSION));
    8
    if (null == specVersion)
    8
    if (null == specVersion)
    14
    if (null == impVersion)
    Differences
    Expression1Expression2Difference
    specVersionimpVersionVARIABLE_NAME_MISMATCH
    14
    if (null == impVersion)
    9
    throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);
    9
    throw new ParseException(MISSING + SPECIFICATION_VERSION, 0);
    15
    throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);
    Differences
    Expression1Expression2Difference
    SPECIFICATION_VERSIONIMPLEMENTATION_VERSIONVARIABLE_NAME_MISMATCH
    15
    throw new ParseException(MISSING + IMPLEMENTATION_VERSION, 0);
    10
    final String impTitle = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE));
    10
    final String impTitle = getTrimmedString(attributes.getValue(IMPLEMENTATION_TITLE));
    16
    final String impVendor = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR));
    Differences
    Expression1Expression2Difference
    impTitleimpVendorVARIABLE_NAME_MISMATCH
    IMPLEMENTATION_TITLEIMPLEMENTATION_VENDORVARIABLE_NAME_MISMATCH
    16
    final String impVendor = getTrimmedString(attributes.getValue(IMPLEMENTATION_VENDOR));
    11
    if (null == impTitle)
    11
    if (null == impTitle)
    17
    if (null == impVendor)
    Differences
    Expression1Expression2Difference
    impTitleimpVendorVARIABLE_NAME_MISMATCH
    17
    if (null == impVendor)
    12
    throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);
    12
    throw new ParseException(MISSING + IMPLEMENTATION_TITLE, 0);
    18
    throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0);
    Differences
    Expression1Expression2Difference
    IMPLEMENTATION_TITLEIMPLEMENTATION_VENDORVARIABLE_NAME_MISMATCH
    18
    throw new ParseException(MISSING + IMPLEMENTATION_VENDOR, 0);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables specVersion, impTitle , while Clone fragment #2 returns variables impVersion, impVendor