String sectionName = section.getName(); if (sectionName == null) { throw new BuildException("Sections must have a name"); } sections.put(sectionName, section); if (!sectionIndex.contains(sectionName)) { sectionIndex.addElement(sectionName); }
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 addConfiguredSection(Section) Method name: void addRootClass(String)
Number of AST nodes: 6 Number of AST nodes: 4
1
String sectionName = section.getName();
2
        if (sectionName == null) {
3
            throw new BuildException("Sections must have a name");
4
        }
5
        sections.put(sectionName, section);
6
        if (!sectionIndex
1
if (className == null) {
2
            return;
3
        }
7
.contains(sectionName)) {
4
        if (!rootClasses.contains(className)) {
8
            sectionIndex.addElement(sectionName);
5
            rootClasses.addElement(className);
9
        }
6
        }
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.2
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    String sectionName = section.getName();
                                                                                    
    2
    if (sectionName == null)
    2
    if (sectionName == null)
    1
    if (className == null)
    Differences
    Expression1Expression2Difference
    sectionNameclassNameVARIABLE_NAME_MISMATCH
    1
    if (className == null)
                        
    2
    return;
    Preondition Violations
    Unmatched return;
    2
    return;
    3
    throw new BuildException("Sections must have a name");
    3
    throw new BuildException("Sections must have a name");
    Preondition Violations
    Unmatched throw new BuildException("Sections must have a name");
                                                                                                                      
    4
    sections.put(sectionName, section);
                                                                              
    5
    if (!sectionIndex.contains(sectionName))
    5
    if (!sectionIndex.contains(sectionName))
    3
    if (!rootClasses.contains(className))
    Differences
    Expression1Expression2Difference
    sectionNameclassNameVARIABLE_NAME_MISMATCH
    sectionIndexrootClassesVARIABLE_NAME_MISMATCH
    3
    if (!rootClasses.contains(className))
    6
    sectionIndex.addElement(sectionName);
    6
    sectionIndex.addElement(sectionName);
    4
    rootClasses.addElement(className);
    Differences
    Expression1Expression2Difference
    sectionNameclassNameVARIABLE_NAME_MISMATCH
    sectionIndexrootClassesVARIABLE_NAME_MISMATCH
    4
    rootClasses.addElement(className);
    Precondition Violations (2)
    Row Violation
    1Unmatched return;
    2Unmatched throw new BuildException("Sections must have a name");