if (isUsingOptimisticLocking()) {
assertFalse(regionRoot == null);
assertEquals(0, getValidChildrenCount(regionRoot));
assertTrue(regionRoot.isValid());
assertTrue(regionRoot.isResident());
}
else {
assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid());
}
if (isUsingOptimisticLocking()) {
assertFalse(regionRoot == null);
assertEquals(0, getValidChildrenCount(regionRoot));
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/collection/AbstractCollectionRegionAccessStrategyTestCase.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/entity/AbstractEntityRegionAccessStrategyTestCase.java
|
Method name: void evictOrRemoveAllTest(boolean)
|
|
Method name: void evictOrRemoveAllTest(boolean)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (isUsingOptimisticLocking()) {↵ | | 1 | if (isUsingOptimisticLocking()) {↵
|
2 | assertFalse(regionRoot == null);↵ | | 2 | assertFalse(regionRoot == null);↵
|
3 | assertEquals(0, getValidChildrenCount(regionRoot));↵ | | 3 | assertEquals(0, getValidChildrenCount(regionRoot));↵
|
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 different classes having the same super class |
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) | 8.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
32 | if (isUsingOptimisticLocking()) | | 33 | if (isUsingOptimisticLocking()) |
33 | assertFalse(regionRoot == null); | | 34 | assertFalse(regionRoot == null); |
34 | assertEquals(0, getValidChildrenCount(regionRoot)); | | 35 | assertEquals(0, getValidChildrenCount(regionRoot)); |
35 | assertTrue(regionRoot.isValid()); | | 36 | assertTrue(regionRoot.isValid()); |
36 | assertTrue(regionRoot.isResident()); | | 37 | assertTrue(regionRoot.isResident()); |
| | | | |
37 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid()); | | 38 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid()); |
Precondition Violations (0)
Row |
Violation |