if ( FieldInterceptionHelper.isInstrumented( entity ) ) {
FieldInterceptor interceptor = FieldInterceptionHelper.injectFieldInterceptor(
entity,
persister.getEntityName(),
null,
source
);
interceptor.dirty();
}
errorIfClosed();
Object result = getFactory().getEntityPersister(entityName)
.load(id, null, lockMode, this);
temporaryPersistenceContext.clear();
return result;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/StatelessSessionImpl.java
|
Method name: void markInterceptorDirty(Object, EntityPersister, EventSource)
|
|
Method name: Object get(String, Serializable, LockMode)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
1 | if ( FieldInterceptionHelper.isInstrumented( entity ) ) {↵ | | |
|
2 | FieldInterceptor interceptor = FieldInterceptionHelper.injectFieldInterceptor(↵ | | |
|
3 | entity,↵ | | |
|
4 | p↵ | | 1 | errorIfClosed();↵
|
5 | ersister.getEntityName(),↵ | | 2 | Object result = getFactory().getEntityPersister(entityName)↵
|
6 | null,↵ | | 3 | ↵
|
7 | source↵ | | |
|
8 | );↵ | | |
|
9 | interceptor.dirty();↵ | | |
|
10 | } | | 4 | .load(id, null, lockMode, this);↵
|
| | | 5 | temporaryPersistenceContext.clear();↵
|
| | | 6 | return result;
|
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 in different classes |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | FieldInterceptor interceptor = FieldInterceptionHelper.injectFieldInterceptor(entity, persister.getEntityName(), null, source); | | | |
3 | interceptor.dirty(); | | 1 | errorIfClosed(); |
| | | 2 | Object result = getFactory().getEntityPersister(entityName).load(id, null, lockMode, this); |
| | | 3 | temporaryPersistenceContext.clear(); |
| | | 4 | return result; |
Precondition Violations (9)
Row |
Violation |
1 | Expression interceptor.dirty() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression interceptor.dirty() is a void method call, and thus it cannot be parameterized |
3 | Expression errorIfClosed() is a void method call, and thus it cannot be parameterized |
4 | Expression interceptor.dirty() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression interceptor.dirty() is a void method call, and thus it cannot be parameterized |
6 | Expression errorIfClosed() is a void method call, and thus it cannot be parameterized |
7 | Unmatched statement temporaryPersistenceContext.clear(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched return result; |
9 | The refactoring of the clones is infeasible, because classes org.hibernate.event.def.AbstractSaveEventListener and org.hibernate.impl.StatelessSessionImpl do not have a common superclass |