File path: /hibernate-distribution-3.3.2.GA/project/cache-swarmcache/src/main/java/org/hibernate/cache/SwarmCache.java | File path: /hibernate-distribution-3.3.2.GA/project/cache-swarmcache/src/main/java/org/hibernate/cache/SwarmCache.java | |||
Method name: Object get(Object)
|
Method name: void remove(Object)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if (key instanceof Serializable) {↵ | 1 | if (key instanceof Serializable) {↵ | |
2 | return cache.get( (Serializable) key );↵ | 2 | cache.clear( (Serializable) key );↵ | |
3 | } ↵ | 3 | } ↵ | |
4 | else {↵ | 4 | else {↵ | |
5 | throw new CacheException("Keys must implement Serializable");↵ | 5 | throw new CacheException("Keys must implement Serializable");↵ | |
6 | } | 6 |
| |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
1 | if (key instanceof Serializable) | 1 | if (key instanceof Serializable) | |||||
|
| 2 | cache.clear((Serializable)key); | |||||
2 | return cache.get((Serializable)key); |
| | |||||
else | else | |||||||
3 | throw new CacheException("Keys must implement Serializable"); | 3 | throw new CacheException("Keys must implement Serializable"); |
Row | Violation |
---|---|
1 | Unmatched statement cache.clear((Serializable)key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement return cache.get((Serializable)key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return cache.get((Serializable)key); |