if (attribute == null) { return; } String attributeKey = attribute.getKey(); attributes.put(attributeKey, attribute); if (!attributeIndex.contains(attributeKey)) { attributeIndex.addElement(attributeKey); }
if (className == null) { return; } if (!rootClasses.contains(className)) { rootClasses.addElement(className); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/depend/AbstractAnalyzer.java
Method name: void storeAttribute(Attribute) Method name: void addRootClass(String)
Number of AST nodes: 6 Number of AST nodes: 4
1
if (attribute == null) {
1
if (className == null) {
2
                return;
2
            return;
3
            }
3
        }
4
            String attributeKey = attribute.getKey();
4
        
5
            attributes.put(attributeKey, attribute);
6
            if (!attributeIndex.contains(attributeKey)) {
7
                attributeIndex.addElement(attributeKey);
8
    
5
if (!rootClasses.contains(className)) {
6
            rootClasses.addElement(className);
9
        }
7
        }
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.3
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (attribute == null)
    1
    if (attribute == null)
    1
    if (className == null)
    Differences
    Expression1Expression2Difference
    attributeclassNameVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.Manifest.Attributejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.Manifest.Attribute of variable attribute does not match with type java.lang.String of variable className
    • Make classes org.apache.tools.ant.taskdefs.Manifest.Attribute and java.lang.String extend a common superclass
    1
    if (className == null)
    2
    return;
    2
    return;
    3
    String attributeKey = attribute.getKey();
                                                                                        
    4
    attributes.put(attributeKey, attribute);
                                                                                        
    5
    if (!attributeIndex.contains(attributeKey))
    5
    if (!attributeIndex.contains(attributeKey))
    3
    if (!rootClasses.contains(className))
    Differences
    Expression1Expression2Difference
    attributeKeyclassNameVARIABLE_NAME_MISMATCH
    attributeIndexrootClassesVARIABLE_NAME_MISMATCH
    3
    if (!rootClasses.contains(className))
    6
    attributeIndex.addElement(attributeKey);
    6
    attributeIndex.addElement(attributeKey);
    4
    rootClasses.addElement(className);
    Differences
    Expression1Expression2Difference
    attributeKeyclassNameVARIABLE_NAME_MISMATCH
    attributeIndexrootClassesVARIABLE_NAME_MISMATCH
    4
    rootClasses.addElement(className);
    Precondition Violations (1)
    Row Violation
    1Type org.apache.tools.ant.taskdefs.Manifest.Attribute of variable attribute does not match with type java.lang.String of variable className