Vector v = (Vector) byDir.get(parent); if (v == null) { v = new Vector(); byDir.put(parent, v); }
Hashtable affectedClasses = (Hashtable) affectedClassMap.get(dependentClass); if (affectedClasses == null) { affectedClasses = new Hashtable(); affectedClassMap.put(dependentClass, affectedClasses); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
Method name: void record() Method name: void determineDependencies()
Number of AST nodes: 4 Number of AST nodes: 4
1
Vector v = (Vector) byDir.get(parent
1
Hashtable affectedClasses
2
);
2
                    = (Hashtable) affectedClassMap.get(dependentClass);
3
                if (v == null) {
3
                if (affectedClasses == null) {
4
                    v = new Vector();
4
                    affectedClasses = new Hashtable();
5
                    byDir.put(parent, v);
5
                    affectedClassMap.put(dependentClass, affectedClasses);
6
                }
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 having the same super class
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    Vector v = (Vector)byDir.get(parent);
    12
    Vector v = (Vector)byDir.get(parent);
    Preondition Violations
    Unmatched statement Vector v=(Vector)byDir.get(parent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
                                                                                                                                                                
    37
    Hashtable affectedClasses = (Hashtable)affectedClassMap.get(dependentClass);
    Preondition Violations
    Unmatched statement Hashtable affectedClasses=(Hashtable)affectedClassMap.get(dependentClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    37
    Hashtable affectedClasses = (Hashtable)affectedClassMap.get(dependentClass);
    13
    if (v == null)
    13
    if (v == null)
    38
    if (affectedClasses == null)
    Differences
    Expression1Expression2Difference
    vaffectedClassesVARIABLE_NAME_MISMATCH
    java.util.Vectorjava.util.HashtableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Vector of variable v does not match with type java.util.Hashtable of variable affectedClasses
    • Make classes java.util.Vector and java.util.Hashtable extend a common superclass
    38
    if (affectedClasses == null)
    14
    v = new Vector();
    14
    v = new Vector();
    Preondition Violations
    Unmatched statement v=new Vector(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                          
                                                                            
    39
    affectedClasses = new Hashtable();
    Preondition Violations
    Unmatched statement affectedClasses=new Hashtable(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    39
    affectedClasses = new Hashtable();
    15
    byDir.put(parent, v);
    15
    byDir.put(parent, v);
    40
    affectedClassMap.put(dependentClass, affectedClasses);
    Differences
    Expression1Expression2Difference
    parentdependentClassVARIABLE_NAME_MISMATCH
    java.io.Filejava.lang.StringVARIABLE_TYPE_MISMATCH
    byDiraffectedClassMapVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.io.File of variable parent does not match with type java.lang.String of variable dependentClass
    • Make classes java.io.File and java.lang.String extend a common superclass
    40
    affectedClassMap.put(dependentClass, affectedClasses);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement Vector v=(Vector)byDir.get(parent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Hashtable affectedClasses=(Hashtable)affectedClassMap.get(dependentClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type java.util.Vector of variable v does not match with type java.util.Hashtable of variable affectedClasses
    4Unmatched statement v=new Vector(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement affectedClasses=new Hashtable(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Type java.io.File of variable parent does not match with type java.lang.String of variable dependentClass