while (e.hasMoreElements()) { String strPropName = (String) e.nextElement(); String strValue = props.getProperty(strPropName); filts.addElement(new Filter(strPropName, strValue)); }
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/types/FilterSet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Main.java
Method name: void readFiltersFromFile(File) Method name: void runBuild(ClassLoader)
Number of AST nodes: 4 Number of AST nodes: 4
1
while (e.hasMoreElements()) {
1
while (e.hasMoreElements()) {
2
                 String strPropName = (String) e.nextElement();
2
                    String arg = (String) e.nextElement();
3
                 String strValue = props.getProperty(strPropName);
3
                    String value = 
4
                 filts.addElement(new Filter(strPropName, strV
4
(String) definedProps.get(arg);
5
alue));
5
                    project.setUserProperty(arg, value);
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.1
Clones locationClones are in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    while (e.hasMoreElements())
    28
    while (e.hasMoreElements())
    15
    String strPropName = (String)e.nextElement();
    15
    String strPropName = (String)e.nextElement();
    29
    String arg = (String)e.nextElement();
    Differences
    Expression1Expression2Difference
    strPropNameargVARIABLE_NAME_MISMATCH
    29
    String arg = (String)e.nextElement();
    16
    String strValue = props.getProperty(strPropName);
    16
    String strValue = props.getProperty(strPropName);
    30
    String value = (String)definedProps.get(arg);
    Differences
    Expression1Expression2Difference
    strValuevalueVARIABLE_NAME_MISMATCH
    props.getProperty(strPropName)(String)definedProps.get(arg)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression props.getProperty(strPropName) 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);
    17
    filts.addElement(new Filter(strPropName, strValue));
    17
    filts.addElement(new Filter(strPropName, strValue));
    Preondition Violations
    Unmatched statement filts.addElement(new Filter(strPropName,strValue)); 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 props.getProperty(strPropName) 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 filts.addElement(new Filter(strPropName,strValue)); 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 strPropName, strValue , while Clone fragment #2 returns variables arg, value