File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/Example.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/OnUpdateVisitor.java | |||
Method name: void addComponentTypedValues(String, Object, AbstractComponentType, List, Criteria, CriteriaQuery)
|
Method name: Object processCollection(Object, CollectionType)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 5 | |||
1 | if ( isPropertyIncluded(value, subpath, subtype) ) {↵ | 1 | if ( ↵ | |
2 | if ( subtype.isComponentType() ) {↵ | |||
3 | addComponentTypedValues(subpath, value, (AbstractComponentType) subtype, list, criteria, criteriaQuery);↵ | |||
4 | }↵ | |||
5 | else {↵ | |||
6 | addPropertyTypedValue(value, subtype, list);↵ | |||
7 | }↵ | |||
8 | ↵ | 2 | wrapper.setCurrentSession(session) ) {↵ | |
3 | //a "detached" collection!↵ | |||
4 | if ( !isOwnerUnchanged( wrapper, persister, collectionKey ) ) {↵ | |||
5 | // if the collection belonged to a different entity,↵ | |||
6 | // clean up the existing state of the collection↵ | |||
7 | removeCollection( persister, collectionKey, session );↵ | |||
8 | }↵ | |||
9 | reattachCollection(wrapper, type);↵ | |||
10 | }↵ | |||
11 | else {↵ | |||
12 | // a collection loaded in the current session↵ | |||
13 | // can not possibly be the collection belonging↵ | |||
14 | // to the entity passed to update()↵ | |||
15 | removeCollection(persister, collectionKey, session);↵ | |||
9 | } | 16 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 10 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 6.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | if (isPropertyIncluded(value, subpath, subtype)) |
| 8 | if (wrapper.setCurrentSession(session)) | |||||||||||||||||
10 | if (subtype.isComponentType()) |
| 9 | if (!isOwnerUnchanged(wrapper, persister, collectionKey)) | |||||||||||||||||
11 | addComponentTypedValues(subpath, value, (AbstractComponentType)subtype, list, criteria, criteriaQuery); |
| 10 | removeCollection(persister, collectionKey, session); | |||||||||||||||||
else | | ||||||||||||||||||||
12 | addPropertyTypedValue(value, subtype, list); | | |||||||||||||||||||
| 11 | reattachCollection(wrapper, type); | |||||||||||||||||||
| else | ||||||||||||||||||||
| 12 | removeCollection(persister, collectionKey, session); |
Row | Violation |
---|---|
1 | Expression addComponentTypedValues(subpath,value,(AbstractComponentType)subtype,list,criteria,criteriaQuery) is a void method call, and thus it cannot be parameterized |
2 | Expression removeCollection(persister,collectionKey,session) is a void method call, and thus it cannot be parameterized |
3 | Expression addComponentTypedValues(subpath,value,(AbstractComponentType)subtype,list,criteria,criteriaQuery) is a void method call, and thus it cannot be parameterized |
4 | Expression removeCollection(persister,collectionKey,session) is a void method call, and thus it cannot be parameterized |