File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/proxy/HibernateProxyHelper.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/EntityType.java | |||
Method name: Class getClassWithoutInitializingProxy(Object)
|
Method name: Serializable getIdentifier(Object, EntityPersister, EntityMode)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (object instanceof HibernateProxy) {↵ | 1 | if (object instanceof HibernateProxy) {↵ | |
2 | HibernateProxy proxy = (HibernateProxy) object;↵ | 2 | HibernateProxy proxy = (HibernateProxy) object;↵ | |
3 | LazyInitializer li = proxy.getHibernateLazyInitializer();↵ | 3 | LazyInitializer li = proxy.getHibernateLazyInitializer();↵ | |
4 | return li.getPersistentClass();↵ | 4 | return li.getIdentifier();↵ | |
5 | }↵ | 5 | }↵ | |
6 | else {↵ | 6 | else {↵ | |
7 | return object.getClass();↵ | 7 | return persister.getIdentifier( object, entityMode );↵ | |
8 | } | 8 |
| |
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 in different classes |
Number of node comparisons | 25 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
1 | if (object instanceof HibernateProxy) | 1 | if (object instanceof HibernateProxy) | |||||
2 | HibernateProxy proxy = (HibernateProxy)object; | 2 | HibernateProxy proxy = (HibernateProxy)object; | |||||
3 | LazyInitializer li = proxy.getHibernateLazyInitializer(); | 3 | LazyInitializer li = proxy.getHibernateLazyInitializer(); | |||||
| 4 | return li.getIdentifier(); | ||||||
4 | return li.getPersistentClass(); | | ||||||
else | | |||||||
|
| 5 | return persister.getIdentifier(object, entityMode); | |||||
5 | return object.getClass(); |
| |
Row | Violation |
---|---|
1 | Unmatched statement return persister.getIdentifier(object,entityMode); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return persister.getIdentifier(object,entityMode); |
3 | Unmatched statement return object.getClass(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return object.getClass(); |