Hashtable affectedClasses = (Hashtable) affectedClassMap.get(dependentClass); if (affectedClasses == null) { affectedClasses = new Hashtable(); affectedClassMap.put(dependentClass, affectedClasses); }
Vector v = (Vector) byDir.get(parent); if (v == null) { v = new Vector(); byDir.put(parent, v); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/Depend.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
Method name: void determineDependencies() Method name: void record()
Number of AST nodes: 4 Number of AST nodes: 4
1
Hashtable affectedClasses
2
                    = (Hashtable) affectedClassMap.get(dependentClass);
1
Vector v = (Vector) byDir.get(parent);
3
                if (affectedClasses == null) {
2
                if (v == null) {
4
                    affectedClasses = new Hashtable();
3
                    v = new Vector();
5
                    affectedClassMap.put(dependentClass, affectedClasses);
4
                    byDir.put(parent, v);
6
                }
5
                }
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)1.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)6.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                  
    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
    12
    Vector v = (Vector)byDir.get(parent);
    37
    Hashtable affectedClasses = (Hashtable)affectedClassMap.get(dependentClass);
    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
                                                                                                                                                                
    38
    if (affectedClasses == null)
    38
    if (affectedClasses == null)
    13
    if (v == null)
    Differences
    Expression1Expression2Difference
    affectedClassesvVARIABLE_NAME_MISMATCH
    java.util.Hashtablejava.util.VectorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Hashtable of variable affectedClasses does not match with type java.util.Vector of variable v
    • Make classes java.util.Hashtable and java.util.Vector extend a common superclass
    13
    if (v == null)
                                          
    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
    14
    v = new Vector();
    39
    affectedClasses = new Hashtable();
    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
                                                                            
    40
    affectedClassMap.put(dependentClass, affectedClasses);
    40
    affectedClassMap.put(dependentClass, affectedClasses);
    15
    byDir.put(parent, v);
    Differences
    Expression1Expression2Difference
    dependentClassparentVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    affectedClassesvVARIABLE_NAME_MISMATCH
    java.util.Hashtablejava.util.VectorVARIABLE_TYPE_MISMATCH
    affectedClassMapbyDirVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.String of variable dependentClass does not match with type java.io.File of variable parent
    • Make classes java.lang.String and java.io.File extend a common superclass
    Type java.util.Hashtable of variable affectedClasses does not match with type java.util.Vector of variable v
    • Make classes java.util.Hashtable and java.util.Vector extend a common superclass
    15
    byDir.put(parent, v);
    Precondition Violations (7)
    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.Hashtable of variable affectedClasses does not match with type java.util.Vector of variable v
    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.lang.String of variable dependentClass does not match with type java.io.File of variable parent
    7Type java.util.Hashtable of variable affectedClasses does not match with type java.util.Vector of variable v