toAnalyze.clear(); // now recover all the dependencies collected and add to the list. Enumeration depsEnum = analyzedDeps.elements(); while (depsEnum.hasMoreElements()) { String className = (String) depsEnum.nextElement(); if (!dependencies.containsKey(className)) { toAnalyze.put(className, className); } }
toAnalyze.clear(); // now recover all the dependencies collected and add to the list. Enumeration depsEnum = dependencyVisitor.getDependencies(); while (depsEnum.hasMoreElements()) { String className = (String) depsEnum.nextElement(); if (!dependencies.containsKey(className)) { toAnalyze.put(className, className); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/AntAnalyzer.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java
Method name: void determineDependencies(Vector, Vector) Method name: void determineDependencies(Vector, Vector)
Number of AST nodes: 6 Number of AST nodes: 6
1
toAnalyze.clear();
1
toAnalyze.clear();
2
            // now recover all the dependencies collected and add to the list.
2
            // now recover all the dependencies collected and add to the list.
3
            Enumeration depsEnum = analyzedDeps.elements();
3
            Enumeration depsEnum = dependencyVisitor.getDependencies();
4
            while (depsEnum.hasMoreElements()) {
4
            while (depsEnum.hasMoreElements()) {
5
                String className = (String) depsEnum.nextElement();
5
                String className = (String) depsEnum.nextElement();
6
                if (!dependencies.containsKey(className)) {
6
                if (!dependencies.containsKey(className)) {
7
                    toAnalyze.put(className, className);
7
                    toAnalyze.put(className, className);
8
                }
8
                }
9
            }
9
            }
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 having the same super class
Number of node comparisons22
  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)14.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    36
    toAnalyze.clear();
    26
    toAnalyze.clear();
                                                                                                                              
    27
    Enumeration depsEnum = dependencyVisitor.getDependencies();
    Preondition Violations
    Unmatched statement Enumeration depsEnum=dependencyVisitor.getDependencies(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    27
    Enumeration depsEnum = dependencyVisitor.getDependencies();
    37
    Enumeration depsEnum = analyzedDeps.elements();
    37
    Enumeration depsEnum = analyzedDeps.elements();
    Preondition Violations
    Unmatched statement Enumeration depsEnum=analyzedDeps.elements(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                      
    38
    while (depsEnum.hasMoreElements())
    28
    while (depsEnum.hasMoreElements())
    39
    String className = (String)depsEnum.nextElement();
    29
    String className = (String)depsEnum.nextElement();
    40
    if (!dependencies.containsKey(className))
    30
    if (!dependencies.containsKey(className))
    41
    toAnalyze.put(className, className);
    31
    toAnalyze.put(className, className);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement Enumeration depsEnum=dependencyVisitor.getDependencies(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Enumeration depsEnum=analyzedDeps.elements(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted