assertTrue(!CollectionUtils.equals(h1, p2));
assertTrue(!CollectionUtils.equals(p2, h1));
p2.put("bar", "");
assertTrue(CollectionUtils.equals(h1, p2));
assertTrue(CollectionUtils.equals(p2, h1));
p2.put("baz", "");
assertTrue(!CollectionUtils.equals(h1, p2));
assertTrue(!CollectionUtils.equals(p2, h1));
h1.put("baz", "");
assertTrue(CollectionUtils.equals(h1, p2));
assertTrue(CollectionUtils.equals(p2, h1));
h1.put("zyzzy", "");
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/CollectionUtilsTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/CollectionUtilsTest.java
|
Method name: void testDictionaryEquals()
|
|
Method name: void testDictionaryEquals()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | assertTrue(!CollectionUtils.equals(h1, p2));↵ | | 1 | assertTrue(!CollectionUtils.equals(h1, p2));↵
|
2 | assertTrue(!CollectionUtils.equals(p2, h1));↵ | | 2 | assertTrue(!CollectionUtils.equals(p2, h1));↵
|
3 | p2.put("bar", "");↵ | | 3 | h1.put("baz", "");↵
|
4 | assertTrue(CollectionUtils.equals(h1, p2));↵ | | 4 | assertTrue(CollectionUtils.equals(h1, p2));↵
|
5 | assertTrue(CollectionUtils.equals(p2, h1));↵ | | 5 | assertTrue(CollectionUtils.equals(p2, h1));↵
|
6 | p2.put("baz", ""); | | 6 | h1.put("zyzzy", "");
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 36 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | assertTrue(!CollectionUtils.equals(h1, p2)); | | 17 | assertTrue(!CollectionUtils.equals(h1, p2)); |
12 | assertTrue(!CollectionUtils.equals(p2, h1)); | | 18 | assertTrue(!CollectionUtils.equals(p2, h1)); |
13 | p2.put("bar", ""); | | | |
14 | assertTrue(CollectionUtils.equals(h1, p2)); | | 20 | assertTrue(CollectionUtils.equals(h1, p2)); |
15 | assertTrue(CollectionUtils.equals(p2, h1)); | | 21 | assertTrue(CollectionUtils.equals(p2, h1)); |
16 | p2.put("baz", ""); | | 19 | h1.put("baz", ""); |
| | | 22 | h1.put("zyzzy", ""); |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement p2.put("bar",""); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type java.util.Properties of variable p2 does not match with type java.util.Hashtable of variable h1 |
3 | Unmatched statement h1.put("zyzzy",""); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |