if (entry instanceof ReadWriteCache.Lock) {
// FIXME don't know what to test here
cachedVersionValue = new Long(((ReadWriteCache.Lock) entry).getUnlockTimestamp());
} else {
cachedVersionValue = (Long) ((Map) entry).get("_version");
assertEquals(initialVersion.longValue(), cachedVersionValue.longValue());
}
if ( entry instanceof ReadWriteCache.Lock ) {
//FIXME don't know what to test here
cachedVersionValue = new Long( ( (ReadWriteCache.Lock) entry).getUnlockTimestamp() );
}
else {
cachedVersionValue = ( Long ) ( (Map) entry ).get( "_version" );
assertEquals( initialVersion.longValue(), cachedVersionValue.longValue() );
}
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/functional/AbstractEntityCacheFunctionalTestCase.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testing/src/main/java/org/hibernate/test/cache/BaseCacheProviderTestCase.java
|
Method name: void testStaleWritesLeaveCacheConsistent()
|
|
Method name: void testStaleWritesLeaveCacheConsistent()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (entry instanceof ReadWriteCache.Lock) {↵ | | 1 | if ( entry instanceof ReadWriteCache.Lock ) {↵
|
2 | // FIXME don't know what to test here↵ | | 2 | //FIXME don't know what to test here↵
|
3 | cachedVersionValue = new Long(((ReadWriteCache.Lock) entry).getUnlockTimestamp());↵ | | 3 | cachedVersionValue = new Long( ( (ReadWriteCache.Lock) entry).getUnlockTimestamp() );↵
|
4 | } else {↵ | | |
|
5 | ↵ | | 4 | }↵
|
| | | 5 | else {↵
|
6 | cachedVersionValue = (Long) ((Map) entry).get("_version");↵ | | 6 | cachedVersionValue = ( Long ) ( (Map) entry ).get( "_version" );↵
|
7 | assertEquals(initialVersion.longValue(), cachedVersionValue.longValue());↵ | | 7 | assertEquals( initialVersion.longValue(), cachedVersionValue.longValue() );↵
|
8 | } | | 8 | }
|
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 | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
21 | if (entry instanceof ReadWriteCache.Lock) | | 21 | if (entry instanceof ReadWriteCache.Lock) |
22 | cachedVersionValue = new Long(((ReadWriteCache.Lock)entry).getUnlockTimestamp()); | | 22 | cachedVersionValue = new Long(((ReadWriteCache.Lock)entry).getUnlockTimestamp()); |
| | | | |
23 | cachedVersionValue = (Long)((Map)entry).get("_version"); | | 23 | cachedVersionValue = (Long)((Map)entry).get("_version"); |
24 | assertEquals(initialVersion.longValue(), cachedVersionValue.longValue()); | | 24 | assertEquals(initialVersion.longValue(), cachedVersionValue.longValue()); |
Precondition Violations (0)
Row |
Violation |