public SortedHashTree(Collection<?> keys, Comparator<? super Object> comper) { this(comper); for (Object key : keys) { data.put(key, new SortedHashTree(comper)); } }
public SortedHashTree(Object[] keys, Comparator<? super Object> comper) { this(comper); for (int x = 0; x < keys.length; x++) { data.put(keys[x], new SortedHashTree(comper)); } }
Clone fragments detected by clone detection tool
File path: /apache-jmeter-2.11/src/jorphan/org/apache/jorphan/collections/SortedHashTree.java File path: /apache-jmeter-2.11/src/jorphan/org/apache/jorphan/collections/SortedHashTree.java
Method name: void SortedHashTree(Collection, Comparator) Method name: void SortedHashTree(Object[], Comparator)
Number of AST nodes: 2 Number of AST nodes: 2
1
public SortedHashTree(Collection<?> keys, Comparator<? super Object> comper) {
1
public SortedHashTree(Object[] keys, Comparator<? super Object> comper) {
2
        this(comper);
2
        this(comper);
3
        for (Object key  : keys) {
3
        for (int x = 0; x < keys.length; x++) {
4
            data.put(key, new SortedHashTree(comper));
4
            data.put(keys[x], new SortedHashTree(comper));
5
        }
5
        }
6
    }
6
    }
  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
    Similarity Score0.571
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (Object key : keys)
    2
    for (Object key : keys)
    2
    for (int x = 0; x < keys.length; x++)
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.lang.Object[]VARIABLE_TYPE_MISMATCH
    java.util.Collection<>java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    • Make classes java.util.Collection<> and java.lang.Object[] extend a common superclass
    Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    • Make classes java.util.Collection<> and java.lang.Object[] extend a common superclass
    2
    for (int x = 0; x < keys.length; x++)
    3
    data.put(key, new SortedHashTree(comper));
    3
    data.put(key, new SortedHashTree(comper));
    3
    data.put(keys[x], new SortedHashTree(comper));
    Differences
    Expression1Expression2Difference
    keykeys[x]TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression keys[x] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    data.put(keys[x], new SortedHashTree(comper));
    Precondition Violations (4)
    Row Violation
    1Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    2Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    3Expression key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression keys[x] cannot be parameterized, because it has dependencies to/from statements that will be extracted