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/entity/AbstractEntityRegionAccessStrategyTestCase.java | |||
Method name: void evictOrRemoveAllTest(String)
|
Method name: void evictOrRemoveAllTest(boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (optimistic) {↵ | 1 | if (isUsingOptimisticLocking()) {↵ | |
2 | assertFalse(regionRoot == null);↵ | 2 | assertFalse(regionRoot == null);↵ | |
3 | assertEquals(0, regionRoot.getChildrenNames().size());↵ | 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 |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 36 |
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) | 10.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
51 | if (optimistic) |
| 33 | if (isUsingOptimisticLocking()) | |||||||||||||||||
52 | assertFalse(regionRoot == null); | 34 | assertFalse(regionRoot == null); | ||||||||||||||||||
53 | assertEquals(0, regionRoot.getChildrenNames().size()); |
| 37 | assertTrue(regionRoot.isResident()); | |||||||||||||||||
54 | assertTrue(regionRoot.isValid()); | 36 | assertTrue(regionRoot.isValid()); | ||||||||||||||||||
55 | assertTrue(regionRoot.isResident()); |
| 35 | assertEquals(0, getValidChildrenCount(regionRoot)); | |||||||||||||||||
else | else | ||||||||||||||||||||
56 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid()); | 38 | assertTrue("region root is removed", regionRoot == null || !regionRoot.isValid()); |
Row | Violation |
---|---|
1 | Expression assertEquals(0,regionRoot.getChildrenNames().size()) is a void method call, and thus it cannot be parameterized |
2 | Expression assertTrue(regionRoot.isResident()) is a void method call, and thus it cannot be parameterized |
3 | Expression assertEquals(0,regionRoot.getChildrenNames().size()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertTrue(regionRoot.isResident()) is a void method call, and thus it cannot be parameterized |
5 | Expression assertTrue(regionRoot.isResident()) is a void method call, and thus it cannot be parameterized |
6 | Expression assertEquals(0,getValidChildrenCount(regionRoot)) is a void method call, and thus it cannot be parameterized |
7 | Expression assertTrue(regionRoot.isResident()) is a void method call, and thus it cannot be parameterized |
8 | Expression assertEquals(0,getValidChildrenCount(regionRoot)) is a void method call, and thus it cannot be parameterized |