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); } }
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); } }
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/Specification.java
Method name: void Extension(String, String, String, String, String, String, String) Method name: void Specification(String, String, String, String, String, String, String[])
Number of AST nodes: 3 Number of AST nodes: 3
1
if (null != implementationVersion) {
1
if (null != specificationVersion) {
2
            try {
2
            try {
3
                this.implementationVersion
3
                this.specificationVersion
4
                    = new DeweyDecimal(implementationVersion);
4
                    = new DeweyDecimal(specificationVersion);
5
            } catch (final NumberFormatException nfe) {
5
            } catch (final NumberFormatException nfe) {
6
                final String error = "Bad implementation version format '"
6
                final String error = "Bad specification version format '"
7
                    + implementationVersion + "' in '" + extensionName
7
                    + specificationVersion + "' in '" + specificationTitle
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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    if (null != implementationVersion)
    9
    if (null != implementationVersion)
    3
    if (null != specificationVersion)
    Differences
    Expression1Expression2Difference
    implementationVersionspecificationVersionVARIABLE_NAME_MISMATCH
    3
    if (null != specificationVersion)
    10
    try
    10
    try
    4
    try
    Differences
    Expression1Expression2Difference
    extensionNamespecificationTitleVARIABLE_NAME_MISMATCH
    "Bad implementation version format '""Bad specification version format '"LITERAL_VALUE_MISMATCH
    implementationVersionspecificationVersionVARIABLE_NAME_MISMATCH
    4
    try
    11
    this.implementationVersion = new DeweyDecimal(implementationVersion);
    11
    this.implementationVersion = new DeweyDecimal(implementationVersion);
    5
    this.specificationVersion = new DeweyDecimal(specificationVersion);
    Differences
    Expression1Expression2Difference
    implementationVersionspecificationVersionVARIABLE_NAME_MISMATCH
    implementationVersionspecificationVersionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.implementationVersion is a field being modified, and thus it cannot be parameterized
    Expression this.specificationVersion is a field being modified, and thus it cannot be parameterized
    5
    this.specificationVersion = new DeweyDecimal(specificationVersion);
    Precondition Violations (2)
    Row Violation
    1Expression this.implementationVersion is a field being modified, and thus it cannot be parameterized
    2Expression this.specificationVersion is a field being modified, and thus it cannot be parameterized