if (timestamp == null) {
// Double check the distributed cache
Object[] vals = (Object[]) suspendAndGet(key, null, false);
if (vals != null) {
storeDataFromJBC(key, vals);
timestamp = entry.getCurrent();
}
}
for (Object key : children) {
Object[] vals = (Object[]) suspendAndGet(key, null, false);
if (vals != null) {
storeDataFromJBC(key, vals);
}
}
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/timestamp/ClusteredConcurrentTimestampsRegionImpl.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/timestamp/ClusteredConcurrentTimestampsRegionImpl.java
|
Method name: Object get(Object)
|
|
Method name: void populateLocalCache()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | if (timestamp == null) {↵ | | |
|
2 | // Double check the distributed cache↵ | | 1 | for (Object key : children) {↵
|
3 | Object[] vals = (Object[]) suspendAndGet(key, null, false);↵ | | 2 | Object[] vals = (Object[]) suspendAndGet(key, null, false);↵
|
4 | if (vals != null) {↵ | | 3 | if (vals != null) {↵
|
5 | storeDataFromJBC(key, vals);↵ | | 4 | storeDataFromJBC(key, vals);↵
|
6 | timestamp = entry.getCurrent();↵ | | |
|
7 | }↵ | | 5 | }↵
|
8 | } | | 6 | }
|
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 declared in the same class |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | Object[] vals = (Object[])suspendAndGet(key, null, false); | | 3 | Object[] vals = (Object[])suspendAndGet(key, null, false); |
5 | if (vals != null) | | 4 | if (vals != null) |
6 | storeDataFromJBC(key, vals); | | 5 | storeDataFromJBC(key, vals); |
7 | timestamp = entry.getCurrent(); | | | |
Precondition Violations (0)
Row |
Violation |