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/type/CollectionType.java | |||
Method name: CollectionEntry getCollectionEntryOrNull(Object)
|
Method name: boolean contains(Object, Object, SessionImplementor)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if ( coll == null ) {↵ | |||
2 | //it might be an unwrapped collection reference!↵ | |||
3 | //try to find a wrapper (slowish)↵ | |||
4 | Iterator wrappers = IdentityMap.keyIt↵ | 1 | Object element = elems.next();↵ | |
2 | // worrying about proxies is perhaps a little bit of overkill here...↵ | |||
3 | if ( element instanceof HibernateProxy ) {↵ | |||
5 | erator(collectionEntries);↵ | 4 | LazyInitializer li = ( (HibernateProxy) element ).getHibernat↵ | |
6 | while ( wrappers.hasNext() ) {↵ | |||
7 | PersistentCollection pc = (PersistentCollection) wrappers.next↵ | 5 | eLazyInitializer();↵ | |
8 | ();↵ | 6 | if ( !li.isUninitialized() ) element = li.getImplementation();↵ | |
9 | ↵ | 7 | }↵ | |
10 | if ( pc.isWrapper(collection) ) {↵ | 8 | if ( ↵ | |
11 | coll = pc;↵ | |||
12 | break;↵ | |||
13 | }↵ | |||
14 | }↵ | |||
15 | } | 9 |
| |
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 | 8 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 3.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 5 | LazyInitializer li = ((HibernateProxy)element).getHibernateLazyInitializer(); | |||||||||||
8 | PersistentCollection pc = (PersistentCollection)wrappers.next(); |
| | |||||||||||
9 | if (pc.isWrapper(collection)) |
| 6 | if (!li.isUninitialized()) | ||||||||||
|
| 7 | element = li.getImplementation(); | |||||||||||
10 | coll = pc; | | ||||||||||||
11 | break; |
| |
Row | Violation |
---|---|
1 | Unmatched statement LazyInitializer li=((HibernateProxy)element).getHibernateLazyInitializer(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement PersistentCollection pc=(PersistentCollection)wrappers.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement element=li.getImplementation(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched break; |