File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/access/OptimisticTransactionalAccessDelegate.java | File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/access/OptimisticTransactionalAccessDelegate.java | |||
Method name: boolean putFromLoad(Object, Object, long, Object, boolean)
|
Method name: boolean update(Object, Object, Object, Object)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 4 | |||
1 | region.ensureRegionRootExists();↵ | 1 | region.ensureRegionRootExists();↵ | |
2 | // We ignore minimalPutOverride. JBossCache putForExternalRead is↵ | |||
3 | // already about as minimal as we can get; it will promptly return↵ | |||
4 | // if it discovers that the node we want to write to already exists↵ | |||
5 | Option opt = getDataVersionOption(version, version);↵ | 2 | Option opt = getDataVersionOption(currentVersion, previousVersion);↵ | |
6 | return CacheHelper.putForExternalRead(cache, regionFqn, key, value, opt); | 3 | CacheHelper.put(cache, regionFqn, key, value, opt);↵ | |
4 |
| |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 12 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | region.ensureRegionRootExists(); | 1 | region.ensureRegionRootExists(); | ||||||||||||||
2 | Option opt = getDataVersionOption(version, version); |
| 2 | Option opt = getDataVersionOption(currentVersion, previousVersion); | |||||||||||||
| 3 | CacheHelper.put(cache, regionFqn, key, value, opt); | |||||||||||||||
3 | return CacheHelper.putForExternalRead(cache, regionFqn, key, value, opt); |
| 4 | return true; |
Row | Violation |
---|---|
1 | Expression CacheHelper.putForExternalRead(cache,regionFqn,key,value,opt) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables opt |