File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/stat/SecondLevelCacheStatistics.java | |||
Method name: void serialize(ObjectOutputStream)
|
Method name: Map getEntries()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | while ( itr.hasNext() ) {↵ | 1 | while ( iter.hasNext() ) {↵ | |
2 | Map.Entry entry = ( Map.Entry ) itr.next();↵ | 2 | Map.Entry me = (Map.Entry) iter.next();↵ | |
3 | ( ( EntityKey ) entry.getKey() ).serialize( oos );↵ | 3 | map.put( ( (CacheKey) me.getKey() ).↵ | |
4 | oos.writeObject( entry.getValue() );↵ | 4 | getKey(), me.getValue() );↵ | |
5 | } | 5 |
| |
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 in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 3.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20 | while (itr.hasNext()) |
| 3 | while (iter.hasNext()) | |||||||||||||
21 | Map.Entry entry = (Map.Entry)itr.next(); |
| 4 | Map.Entry me = (Map.Entry)iter.next(); | |||||||||||||
|
| 5 | map.put(((CacheKey)me.getKey()).getKey(), me.getValue()); | ||||||||||||||
22 | ((EntityKey)entry.getKey()).serialize(oos); |
| | ||||||||||||||
23 | oos.writeObject(entry.getValue()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement map.put(((CacheKey)me.getKey()).getKey(),me.getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement ((EntityKey)entry.getKey()).serialize(oos); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement ((EntityKey)entry.getKey()).serialize(oos); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
4 | Unmatched statement oos.writeObject(entry.getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement oos.writeObject(entry.getValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
6 | The refactoring of the clones is infeasible, because classes org.hibernate.engine.StatefulPersistenceContext and org.hibernate.stat.SecondLevelCacheStatistics do not have a common superclass |