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 super Object>)
|
|
Method name: void SortedHashTree(Object[], Comparator super Object>)
|
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 | } |
See real code fragment |
|
See real code fragment |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.571 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | for (Object key : keys) | | 2 | for (int x = 0; x < keys.length; x++) |
3 | data.put(key, new SortedHashTree(comper)); | | 3 | data.put(keys[x], new SortedHashTree(comper)); |
Precondition Violations (4)
Row |
Violation |
1 | Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys |
2 | Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys |
3 | Expression key cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression keys[x] cannot be parameterized, because it has dependencies to/from statements that will be extracted |