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/engine/StatefulPersistenceContext.java | |||
Method name: Serializable getOwnerId(String, String, Object, Map)
|
Method name: Object getIndexInOwner(String, String, Object, Map)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if ( !found && mergeMap != null ) {↵ | 1 | if (index==null && mergeMap!=null) {↵ | |
2 | //check if the detached object being merged is the parent↵ | 2 | ↵ | |
3 | Object unmergedInstance = mergeMap.get( entityEntryInstance );↵ | 3 | Object unmergedInstance = mergeMap.get(instance);↵ | |
4 | Object unmergedChild = mergeMap.get( childEntity );↵ | 4 | Object unmergedChild = mergeMap.get(childEntity);↵ | |
5 | if ( unmergedInstance != null && unmergedChild != null ) {↵ | 5 | if ( unmergedInstance!=null && unmergedChild!=null ) {↵ | |
6 | found = isFoundInParent(↵ | 6 | ↵ | |
7 | propertyName,↵ | |||
8 | unmergedChild,↵ | 7 | index = getIndexInParent(property, unmergedChild,↵ | |
9 | persister,↵ | 8 | persister,↵ | |
10 | collectionPersister,↵ | |||
11 | unmergedInstance↵ | 9 | cp, unmergedInstance↵ | |
12 | );↵ | 10 | );↵ | |
13 | }↵ | 11 | }↵ | |
14 | } | 12 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 15 |
Number of mapped statements | 4 |
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) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | if (!found && mergeMap != null) |
| 10 | if (index == null && mergeMap != null) | ||||||||||
12 | Object unmergedInstance = mergeMap.get(entityEntryInstance); |
| 11 | Object unmergedInstance = mergeMap.get(instance); | ||||||||||
13 | Object unmergedChild = mergeMap.get(childEntity); | 12 | Object unmergedChild = mergeMap.get(childEntity); | |||||||||||
14 | if (unmergedInstance != null && unmergedChild != null) | 13 | if (unmergedInstance != null && unmergedChild != null) | |||||||||||
|
| 14 | index = getIndexInParent(property, unmergedChild, persister, cp, unmergedInstance); | |||||||||||
15 | found = isFoundInParent(propertyName, unmergedChild, persister, collectionPersister, unmergedInstance); |
| |
Row | Violation |
---|---|
1 | Unmatched statement index=getIndexInParent(property,unmergedChild,persister,cp,unmergedInstance); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement found=isFoundInParent(propertyName,unmergedChild,persister,collectionPersister,unmergedInstance); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables unmergedInstance, unmergedChild , while Clone fragment #2 returns variables unmergedInstance, unmergedChild |