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;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    FieldInterceptor interceptor = FieldInterceptionHelper.injectFieldInterceptor(entity, persister.getEntityName(), null, source);
                                                                                                                                                                                                                                                              
    3
    interceptor.dirty();
    3
    interceptor.dirty();
    1
    errorIfClosed();
    Differences
    Expression1Expression2Difference
    dirtyerrorIfClosedMETHOD_INVOCATION_NAME_MISMATCH
    interceptorMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression interceptor.dirty() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression interceptor.dirty() is a void method call, and thus it cannot be parameterized
    Expression errorIfClosed() is a void method call, and thus it cannot be parameterized
    Expression interceptor.dirty() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression interceptor.dirty() is a void method call, and thus it cannot be parameterized
    Expression errorIfClosed() is a void method call, and thus it cannot be parameterized
    1
    errorIfClosed();
                                                                                                                                                                                      
    2
    Object result = getFactory().getEntityPersister(entityName).load(id, null, lockMode, this);
                                                                                  
    3
    temporaryPersistenceContext.clear();
    Preondition Violations
    Unmatched statement temporaryPersistenceContext.clear(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    temporaryPersistenceContext.clear();
                                      
    4
    return result;
    Preondition Violations
    Unmatched return result;
    4
    return result;
    Precondition Violations (9)
    Row Violation
    1Expression interceptor.dirty() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression interceptor.dirty() is a void method call, and thus it cannot be parameterized
    3Expression errorIfClosed() is a void method call, and thus it cannot be parameterized
    4Expression interceptor.dirty() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression interceptor.dirty() is a void method call, and thus it cannot be parameterized
    6Expression errorIfClosed() is a void method call, and thus it cannot be parameterized
    7Unmatched statement temporaryPersistenceContext.clear(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched return result;
    9The refactoring of the clones is infeasible, because classes org.hibernate.event.def.AbstractSaveEventListener and org.hibernate.impl.StatelessSessionImpl do not have a common superclass