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: Object getIndexInOwner(String, String, Object, Map)
|
Method name: Serializable getOwnerId(String, String, Object, Map)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (index==null && mergeMap!=null) {↵ | 1 | if ( !found && mergeMap != null ) {↵ | |
2 | ↵ | 2 | //check if the detached object being merged is the parent↵ | |
3 | Object unmergedInstance = mergeMap.get(instance);↵ | 3 | Object unmergedInstance = mergeMap.get( entityEntryInstance );↵ | |
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 | index = getIndexInParent(property, ↵ | 6 | found = isFoundInParent(↵ | |
7 | propertyName,↵ | |||
7 | unmergedChild, ↵ | 8 | unmergedChild,↵ | |
8 | persister, cp, ↵ | 9 | persister,↵ | |
10 | collectionPersister,↵ | |||
9 | unmergedInstance↵ | 11 | unmergedInstance↵ | |
10 | );↵ | 12 | );↵ | |
11 | }↵ | 13 | }↵ | |
12 | } | 14 |
| |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | if (index == null && mergeMap != null) |
| 11 | if (!found && mergeMap != null) | ||||||||||
11 | Object unmergedInstance = mergeMap.get(instance); |
| 12 | Object unmergedInstance = mergeMap.get(entityEntryInstance); | ||||||||||
12 | Object unmergedChild = mergeMap.get(childEntity); | 13 | Object unmergedChild = mergeMap.get(childEntity); | |||||||||||
13 | if (unmergedInstance != null && unmergedChild != null) | 14 | 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 |