String id = attr.getValue("id"); if (id != null) { project.addIdReference(id, element); }
String id = attr.getValue("id"); if (id != null) { project.addReference(id, target); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/helper/AntXMLContext.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/helper/ProjectHelperImpl.java
Method name: void configureId(Object, Attributes) Method name: void configureId(Object, AttributeList)
Number of AST nodes: 3 Number of AST nodes: 3
1
String id = attr.getValue("id");
1
String id = attr.getValue("id");
2
        if (id != null) {
2
        if (id != null) {
3
            project.addIdReference(id, element);
3
            project.addReference(id, target);
4
        }
4
        }
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.1
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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String id = attr.getValue("id");
    1
    String id = attr.getValue("id");
    1
    String id = attr.getValue("id");
    Differences
    Expression1Expression2Difference
    org.xml.sax.Attributesorg.xml.sax.AttributeListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.xml.sax.Attributes of variable attr does not match with type org.xml.sax.AttributeList of variable attr
    • Make classes org.xml.sax.Attributes and org.xml.sax.AttributeList extend a common superclass
    1
    String id = attr.getValue("id");
    2
    if (id != null)
    2
    if (id != null)
    3
    project.addIdReference(id, element);
    3
    project.addIdReference(id, element);
    3
    project.addReference(id, target);
    Differences
    Expression1Expression2Difference
    addIdReferenceaddReferenceMETHOD_INVOCATION_NAME_MISMATCH
    elementtargetVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression project.addIdReference(id,element) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression project.addReference(id,target) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression project.addIdReference(id,element) is a void method call, and thus it cannot be parameterized
    Expression project.addReference(id,target) is a void method call, and thus it cannot be parameterized
    3
    project.addReference(id, target);
    Precondition Violations (5)
    Row Violation
    1Type org.xml.sax.Attributes of variable attr does not match with type org.xml.sax.AttributeList of variable attr
    2Expression project.addIdReference(id,element) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression project.addReference(id,target) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression project.addIdReference(id,element) is a void method call, and thus it cannot be parameterized
    5Expression project.addReference(id,target) is a void method call, and thus it cannot be parameterized