String key = (String) e.nextElement(); String property = additionalUserProperties.getProperty(key); definedProps.put(key, property);
while (e.hasMoreElements()) { String arg = (String) e.nextElement(); String value = (String) definedProps.get(arg); project.setUserProperty(arg, value); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java
Method name: void startAnt(String[], Properties, ClassLoader) Method name: void runBuild(ClassLoader)
Number of AST nodes: 3 Number of AST nodes: 4
1
while (e.hasMoreElements()) {
1
String key = (String) e.nextElement();
2
                    String arg = (String) e.nextElement();
2
                String property = additionalUserProperties.getProperty(key);
3
                    String 
3
                definedProps.put(key, property);
4
value = (String) definedProps.get(arg);
5
                    project.setUserProperty(arg, value);
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.0
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    String key = (String)e.nextElement();
    6
    String key = (String)e.nextElement();
    29
    String arg = (String)e.nextElement();
    Differences
    Expression1Expression2Difference
    keyargVARIABLE_NAME_MISMATCH
    29
    String arg = (String)e.nextElement();
    7
    String property = additionalUserProperties.getProperty(key);
    7
    String property = additionalUserProperties.getProperty(key);
    30
    String value = (String)definedProps.get(arg);
    Differences
    Expression1Expression2Difference
    propertyvalueVARIABLE_NAME_MISMATCH
    additionalUserProperties.getProperty(key)(String)definedProps.get(arg)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression additionalUserProperties.getProperty(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (String)definedProps.get(arg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30
    String value = (String)definedProps.get(arg);
    8
    definedProps.put(key, property);
    8
    definedProps.put(key, property);
    Preondition Violations
    Unmatched statement definedProps.put(key,property); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
                                                                                  
    31
    project.setUserProperty(arg, value);
    Preondition Violations
    Unmatched statement project.setUserProperty(arg,value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    31
    project.setUserProperty(arg, value);
    Precondition Violations (5)
    Row Violation
    1Expression additionalUserProperties.getProperty(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (String)definedProps.get(arg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement definedProps.put(key,property); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement project.setUserProperty(arg,value); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variables key, property , while Clone fragment #2 returns variables arg, value