if (null != specificationVersion) { try { this.specificationVersion = new DeweyDecimal(specificationVersion); } catch (final NumberFormatException nfe) { final String error = "Bad specification version format '" + specificationVersion + "' in '" + specificationTitle + "'. (Reason: " + nfe + ")"; throw new IllegalArgumentException(error); } }
if (null != implementationVersion) { try { this.implementationVersion = new DeweyDecimal(implementationVersion); } catch (final NumberFormatException nfe) { final String error = "Bad implementation version format '" + implementationVersion + "' in '" + extensionName + "'. (Reason: " + nfe + ")"; throw new IllegalArgumentException(error); } }
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/Extension.java
Method name: void Specification(String, String, String, String, String, String, String[]) Method name: void Extension(String, String, String, String, String, String, String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (null != specificationVersion) {
1
if (null != implementationVersion) {
2
            try {
2
            try {
3
                this.specificationVersion
3
                this.implementationVersion
4
                    = new DeweyDecimal(specificationVersion);
4
                    = new DeweyDecimal(implementationVersion);
5
            } catch (final NumberFormatException nfe) {
5
            } catch (final NumberFormatException nfe) {
6
                final String error = "Bad specification version format '"
6
                final String error = "Bad implementation version format '"
7
                    + specificationVersion + "' in '" + specificationTitle
7
                    + implementationVersion + "' in '" + extensionName
8
                    + "'. (Reason: " + nfe + ")";
8
                    + "'. (Reason: " + nfe + ")";
9
                throw new IllegalArgumentException(error);
9
                throw new IllegalArgumentException(error);
10
            }
10
            }
11
        }
11
        }
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 different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (null != specificationVersion)
    3
    if (null != specificationVersion)
    9
    if (null != implementationVersion)
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    9
    if (null != implementationVersion)
    4
    try
    4
    try
    10
    try
    Differences
    Expression1Expression2Difference
    specificationTitleextensionNameVARIABLE_NAME_MISMATCH
    "Bad specification version format '""Bad implementation version format '"LITERAL_VALUE_MISMATCH
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    10
    try
    5
    this.specificationVersion = new DeweyDecimal(specificationVersion);
    5
    this.specificationVersion = new DeweyDecimal(specificationVersion);
    11
    this.implementationVersion = new DeweyDecimal(implementationVersion);
    Differences
    Expression1Expression2Difference
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    specificationVersionimplementationVersionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.specificationVersion is a field being modified, and thus it cannot be parameterized
    Expression this.implementationVersion is a field being modified, and thus it cannot be parameterized
    11
    this.implementationVersion = new DeweyDecimal(implementationVersion);
    Precondition Violations (2)
    Row Violation
    1Expression this.specificationVersion is a field being modified, and thus it cannot be parameterized
    2Expression this.implementationVersion is a field being modified, and thus it cannot be parameterized