if (newRoot instanceof NodeSPI) {
// FIXME Hacky workaround to JBCACHE-1202
if ( !( ( ( NodeSPI ) newRoot ).getVersion() instanceof NonLockingDataVersion ) ) {
((NodeSPI) newRoot).setVersion(NonLockingDataVersion.INSTANCE);
}
}
if (optimistic && regionRoot instanceof NodeSPI) {
// FIXME Hacky workaround to JBCACHE-1202
if ( !( ( ( NodeSPI ) regionRoot ).getVersion() instanceof NonLockingDataVersion ) ) {
((NodeSPI) regionRoot).setVersion(NonLockingDataVersion.INSTANCE);
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/BasicRegionAdapter.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/BasicRegionAdapter.java
|
Method name: void establishRegionRootNode()
|
|
Method name: void activateLocalClusterNode()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (newRoot instanceof NodeSPI) {↵ | | 1 | if (optimistic && regionRoot instanceof NodeSPI) {↵
|
2 | // FIXME Hacky workaround to JBCACHE-1202↵ | | 2 | // FIXME Hacky workaround to JBCACHE-1202↵
|
3 | if ( !( ( ( NodeSPI ) newRoot ).getVersion() instanceof NonLockingDataVersion ) ) {↵ | | 3 | if ( !( ( ( NodeSPI ) regionRoot ).getVersion() instanceof NonLockingDataVersion ) ) {↵
|
4 | ((NodeSPI) newRoot).setVersion(NonLockingDataVersion.INSTANCE);↵ | | 4 | ((NodeSPI) regionRoot).setVersion(NonLockingDataVersion.INSTANCE);↵
|
5 | }↵ | | 5 | ↵
|
6 | ↵ | | 6 | }↵
|
7 | } | | 7 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | if (!(((NodeSPI)newRoot).getVersion() instanceof NonLockingDataVersion)) | | 17 | if (!(((NodeSPI)regionRoot).getVersion() instanceof NonLockingDataVersion)) |
16 | ((NodeSPI)newRoot).setVersion(NonLockingDataVersion.INSTANCE); | | 18 | ((NodeSPI)regionRoot).setVersion(NonLockingDataVersion.INSTANCE); |
Precondition Violations (0)
Row |
Violation |