HibernateProxy proxy = (HibernateProxy) maybeProxy;
LazyInitializer li = proxy.getHibernateLazyInitializer();
reassociateProxy(li, proxy);
return li.getImplementation();
HibernateProxy proxy = (HibernateProxy) value;
LazyInitializer li = proxy.getHibernateLazyInitializer();
reassociateProxy(li, proxy);
return true;
Clone fragments detected by clone detection tool
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 unproxyAndReassociate(Object)
|
|
Method name: boolean reassociateIfUninitializedProxy(Object)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | HibernateProxy proxy = (HibernateProxy) maybeProxy;↵ | | 1 | HibernateProxy proxy = (HibernateProxy) value;↵
|
2 | LazyInitializer li = proxy.getHibernateLazyInitializer();↵ | | 2 | LazyInitializer li = proxy.getHibernateLazyInitializer();↵
|
3 | reassociateProxy(li, proxy);↵ | | 3 | reassociateProxy(li, proxy);↵
|
4 | return li.getImplementation(); | | 4 | return true;
|
See real code fragment |
|
See real code fragment |
Summary
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | HibernateProxy proxy = (HibernateProxy)maybeProxy; | | 4 | HibernateProxy proxy = (HibernateProxy)value; |
5 | LazyInitializer li = proxy.getHibernateLazyInitializer(); | | 5 | LazyInitializer li = proxy.getHibernateLazyInitializer(); |
6 | reassociateProxy(li, proxy); | | 6 | reassociateProxy(li, proxy); |
| | | 7 | return true; |
7 | return li.getImplementation(); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched return true; |
2 | Clone fragment #1 returns variables li , while Clone fragment #2 returns variables |