if ( collectionIsInitialized(collection) ) {
// handles arrays and newly instantiated collections
return collectionType.getElementsIterator(collection, session);
}
else {
// does not handle arrays (thats ok, cos they can't be lazy)
// or newly instantiated collections, so we can do the cast
return ( (PersistentCollection) collection ).queuedAdditionIterator();
}
if (session==null) {
return BackrefPropertyAccessor.UNKNOWN;
}
else {
return session.getPersistenceContext()
.getIndexInOwner(entityName, propertyName, target, mergeMap);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/CascadingAction.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/IndexPropertyAccessor.java
|
Method name: Iterator getLoadedElementsIterator(SessionImplementor, CollectionType, Object)
|
|
Method name: Object getForInsert(Object, Map, SessionImplementor)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ( collectionIsInitialized(collection) ) {↵ | | 1 | if (↵
|
2 | // handles arrays and newly instantiated collections↵ | | |
|
3 | return collectionType.getElementsIterator(collection, session)↵ | | 2 | session==null) {↵
|
4 | ;↵ | | 3 | return BackrefPropertyAccessor.UNKNOWN;↵
|
5 | }↵ | | 4 | }↵
|
6 | else {↵ | | 5 | else {↵
|
7 | // does not handle arrays (thats ok, cos they can't be lazy)↵ | | 6 | ↵
|
8 | // or newly instantiated collections, so we can do the cast↵ | | |
|
9 | return ( (PersistentCollection) collection ).queuedAdditionIterator(↵ | | 7 | return session.getPersistenceContext()↵
|
10 | );↵ | | 8 | .getIndexInOwner(entityName, propertyName, target, mergeMap);↵
|
11 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |