String name = key.substring(6); tryToSetAParameter(cache, name, value); } else if (key.startsWith("algorithm.")) { String name = key.substring(10); tryToSetAParameter(algorithm, name, value);
String name = key.substring(10); tryToSetAParameter(algorithm, name, value); } else if (key.startsWith("comparator.")) { String name = key.substring(11); tryToSetAParameter(comparator, name, value);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java
Method name: void useParameter(Parameter) Method name: void useParameter(Parameter)
Number of AST nodes: 4 Number of AST nodes: 4
1
String name = key.substring(6);
1
String name = key.substring(10);
2
            tryToSetAParameter(cache, name, value);
2
            tryToSetAParameter(algorithm, name, value);
3
        } else if (key.startsWith("algorithm.")) {
3
        } else if (key.startsWith("comparator.")) {
4
            String name = key.substring(10);
4
            String name = key.substring(11);
5
            tryToSetAParameter(algorithm, name, value);
5
            tryToSetAParameter(comparator, name, value);
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 in the same method
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    25
    String name = key.substring(6);
    25
    String name = key.substring(6);
    28
    String name = key.substring(10);
    Differences
    Expression1Expression2Difference
    610LITERAL_VALUE_MISMATCH
    28
    String name = key.substring(10);
    26
    tryToSetAParameter(cache, name, value);
    26
    tryToSetAParameter(cache, name, value);
    29
    tryToSetAParameter(algorithm, name, value);
    Differences
    Expression1Expression2Difference
    cachealgorithmVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.selectors.modifiedselector.Cacheorg.apache.tools.ant.types.selectors.modifiedselector.AlgorithmVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.selectors.modifiedselector.Cache of variable cache does not match with type org.apache.tools.ant.types.selectors.modifiedselector.Algorithm of variable algorithm
    • Make classes org.apache.tools.ant.types.selectors.modifiedselector.Cache and org.apache.tools.ant.types.selectors.modifiedselector.Algorithm extend a common superclass
    29
    tryToSetAParameter(algorithm, name, value);
    Precondition Violations (1)
    Row Violation
    1Type org.apache.tools.ant.types.selectors.modifiedselector.Cache of variable cache does not match with type org.apache.tools.ant.types.selectors.modifiedselector.Algorithm of variable algorithm