if (options != null) { for (int i = 0; i < options.length; i++) { cmd.createArgument().setValue(options[i]); } }
for (int i = 0; i < r.length; i++) { add(r[i]); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/selectors/ResourceSelectorContainer.java
Method name: Commandline setupRmicCommand(String[]) Method name: void ResourceSelectorContainer(ResourceSelector[])
Number of AST nodes: 3 Number of AST nodes: 2
1
if (options != null) {
2
            for (int i = 0; i < options.length; i++) {
1
for (int i = 0; i < r.length; i++) {
3
                cmd.createArgument().setValue(options[i]);
2
            
4
            }
3
add(r[i]);
5
        }
4
        }
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
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0; i < options.length; i++)
    3
    for (int i = 0; i < options.length; i++)
    1
    for (int i = 0; i < r.length; i++)
    Differences
    Expression1Expression2Difference
    optionsrVARIABLE_NAME_MISMATCH
    java.lang.String[]org.apache.tools.ant.types.resources.selectors.ResourceSelector[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String[] of variable options does not match with type org.apache.tools.ant.types.resources.selectors.ResourceSelector[] of variable r
    • Make classes java.lang.String[] and org.apache.tools.ant.types.resources.selectors.ResourceSelector[] extend a common superclass
    1
    for (int i = 0; i < r.length; i++)
                              
    2
    add(r[i]);
    Preondition Violations
    Unmatched statement add(r[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    add(r[i]);
    4
    cmd.createArgument().setValue(options[i]);
    4
    cmd.createArgument().setValue(options[i]);
    Preondition Violations
    Unmatched statement cmd.createArgument().setValue(options[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    Precondition Violations (3)
    Row Violation
    1Type java.lang.String[] of variable options does not match with type org.apache.tools.ant.types.resources.selectors.ResourceSelector[] of variable r
    2Unmatched statement add(r[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement cmd.createArgument().setValue(options[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted