return false; } Attribute other = (Attribute) obj; if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; }
return true; } Manifest rhsManifest = (Manifest) rhs; if (manifestVersion == null) { if (rhsManifest.manifestVersion != null) { return false; } } else if (!manifestVersion.equals(rhsManifest.manifestVersion)) { return false; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 7 Number of AST nodes: 7
1
return false;
1
return 
2
    
2
true;
3
        }
3
        }
4
            Attribute other = (Attribute) obj;
4
        
5
            if (name
5
Manifest rhsManifest = (Manifest) rhs;
6
 == null) {
6
        if (manifestVersion == null) {
7
                if (other.name != null) {
7
            if (rhsManifest.manifestVersion != null) {
8
                    return false;
8
                return false;
9
                }
9
            }
10
            } else if (!name.equals(other.name)) {
10
        } else if (!manifestVersion.equals(rhsManifest.manifestVersion)) {
11
                return false;
11
            return false;
12
            }
12
        }
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                
    5
    Manifest rhsManifest = (Manifest)rhs;
    5
    Attribute other = (Attribute)obj;
                                                                        
    6
    if (name == null)
    6
    if (name == null)
    6
    if (manifestVersion == null)
    Differences
    Expression1Expression2Difference
    namemanifestVersionVARIABLE_NAME_MISMATCH
    6
    if (manifestVersion == null)
    7
    if (other.name != null)
    7
    if (other.name != null)
    7
    if (rhsManifest.manifestVersion != null)
    Differences
    Expression1Expression2Difference
    otherrhsManifestVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.MacroDef.Attributeorg.apache.tools.ant.taskdefs.ManifestVARIABLE_TYPE_MISMATCH
    namemanifestVersionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable other.name does not match with type java.lang.String of variable rhsManifest.manifestVersion
    • Make classes org.apache.tools.ant.taskdefs.MacroDef.Attribute and org.apache.tools.ant.taskdefs.Manifest extend a common superclass
    Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    if (rhsManifest.manifestVersion != null)
    8
    return false;
    8
    return false;
    9
    else if (!name.equals(other.name))
    9
    else if (!name.equals(other.name))
    9
    else if (!manifestVersion.equals(rhsManifest.manifestVersion))
    Differences
    Expression1Expression2Difference
    otherrhsManifestVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.MacroDef.Attributeorg.apache.tools.ant.taskdefs.ManifestVARIABLE_TYPE_MISMATCH
    namemanifestVersionVARIABLE_NAME_MISMATCH
    namemanifestVersionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable other.name does not match with type java.lang.String of variable rhsManifest.manifestVersion
    • Make classes org.apache.tools.ant.taskdefs.MacroDef.Attribute and org.apache.tools.ant.taskdefs.Manifest extend a common superclass
    Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    else if (!manifestVersion.equals(rhsManifest.manifestVersion))
    10
    return false;
    10
    return false;
    Precondition Violations (11)
    Row Violation
    1Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.lang.String of variable other.name does not match with type java.lang.String of variable rhsManifest.manifestVersion
    4Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.lang.String of variable other.name does not match with type java.lang.String of variable rhsManifest.manifestVersion
    9Expression other.name cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression rhsManifest.manifestVersion cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Not all possible execution flows end in a return statement