File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/ComponentType.java | |||
Method name: Object replace(Object, Object, SessionImplementor, Object, Map)
|
Method name: Object replace(Object, Object, SessionImplementor, Object, Map, ForeignKeyDirection)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if ( original == null ) {↵ | 1 | if ( original == null ) {↵ | |
2 | return null;↵ | 2 | return null;↵ | |
3 | }↵ | 3 | }↵ | |
4 | //if ( original == target ) return target;↵ | 4 | //if ( original == target ) return target;↵ | |
5 | final Object result = target == null↵ | 5 | final Object result = target == null ?↵ | |
6 | ? instantiate( owner, session )↵ | 6 | instantiate( owner, session ) :↵ | |
7 | : target;↵ | 7 | target;↵ | |
8 | final EntityMode entityMode = session.getEntityMode();↵ | 8 | final EntityMode entityMode = session.getEntityMode();↵ | |
9 | Object[] values = TypeFactory.replace(↵ | 9 | Object[] values = TypeFactory.replace(↵ | |
10 | getPropertyValues( original, entityMode ),↵ | 10 | getPropertyValues( original, entityMode ),↵ | |
11 | getPropertyValues( result, entityMode ),↵ | 11 | getPropertyValues( result, entityMode ),↵ | |
12 | propertyTypes,↵ | 12 | propertyTypes,↵ | |
13 | session,↵ | 13 | session,↵ | |
14 | owner,↵ | 14 | owner,↵ | |
15 | copyCache↵ | 15 | copyCache,↵ | |
16 | foreignKeyDirection↵ | |||
16 | );↵ | 17 | );↵ | |
17 | setPropertyValues( result, values, entityMode );↵ | 18 | setPropertyValues( result, values, entityMode );↵ | |
18 | return result; | 19 |
| |
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 declared in the same class |
Number of node comparisons | 29 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (original == null) | 1 | if (original == null) | |||||||||||||
2 | return null; | 2 | return null; | |||||||||||||
3 | final Object result = target == null ? instantiate(owner, session) : target; | 3 | final Object result = target == null ? instantiate(owner, session) : target; | |||||||||||||
4 | final EntityMode entityMode = session.getEntityMode(); | 4 | final EntityMode entityMode = session.getEntityMode(); | |||||||||||||
5 | Object[] values = TypeFactory.replace(getPropertyValues(original, entityMode), getPropertyValues(result, entityMode), propertyTypes, session, owner, copyCache); |
| 5 | Object[] values = TypeFactory.replace(getPropertyValues(original, entityMode), getPropertyValues(result, entityMode), propertyTypes, session, owner, copyCache, foreignKeyDirection); | ||||||||||||
6 | setPropertyValues(result, values, entityMode); | 6 | setPropertyValues(result, values, entityMode); | |||||||||||||
7 | return result; | 7 | return result; |
Row | Violation |
---|---|
1 | Expression TypeFactory.replace(getPropertyValues(original,entityMode),getPropertyValues(result,entityMode),propertyTypes,session,owner,copyCache) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression TypeFactory.replace(getPropertyValues(original,entityMode),getPropertyValues(result,entityMode),propertyTypes,session,owner,copyCache,foreignKeyDirection) cannot be parameterized, because it has dependencies to/from statements that will be extracted |