if (optimistic) {
assertFalse(regionRoot == null);
assertEquals(0, regionRoot.getChildrenNames().size());
assertTrue(regionRoot.isValid());
assertTrue(regionRoot.isResident());
}
else {
assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid());
}
if (optimistic) {
assertFalse(regionRoot == null);
assertEquals(0, regionRoot.getChildrenNames().size());
assertTrue(regionRoot.isValid());
assertTrue(regionRoot.isResident());
}
else {
assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid());
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/AbstractGeneralDataRegionTestCase.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/AbstractGeneralDataRegionTestCase.java
|
Method name: void evictOrRemoveAllTest(String)
|
|
Method name: void evictOrRemoveAllTest(String)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (optimistic) {↵ | | 1 | if (optimistic) {↵
|
2 | assertFalse(regionRoot == null);↵ | | 2 | assertFalse(regionRoot == null);↵
|
3 | assertEquals(0, regionRoot.getChildrenNames().size());↵ | | 3 | assertEquals(0, regionRoot.getChildrenNames().size());↵
|
4 | assertTrue(regionRoot.isValid());↵ | | 4 | assertTrue(regionRoot.isValid());↵
|
5 | assertTrue(regionRoot.isResident());↵ | | 5 | assertTrue(regionRoot.isResident());↵
|
6 | }↵ | | 6 | }↵
|
7 | else {↵ | | 7 | else {↵
|
8 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid());↵ | | 8 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid());↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 36 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 1.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
43 | if (optimistic) | | 51 | if (optimistic) |
44 | assertFalse(regionRoot == null); | | 52 | assertFalse(regionRoot == null); |
45 | assertEquals(0, regionRoot.getChildrenNames().size()); | | 53 | assertEquals(0, regionRoot.getChildrenNames().size()); |
46 | assertTrue(regionRoot.isValid()); | | 54 | assertTrue(regionRoot.isValid()); |
47 | assertTrue(regionRoot.isResident()); | | 55 | assertTrue(regionRoot.isResident()); |
| | | | |
48 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid()); | | 56 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid()); |
Precondition Violations (0)
Row |
Violation |