if ( persister.hasInsertGeneratedProperties() ) { persister.processInsertGeneratedProperties( id, instance, state, session ); if ( persister.isVersionPropertyGenerated() ) { version = Versioning.getVersion(state, persister); } entry.postUpdate(instance, state, version); }
if ( persister.hasUpdateGeneratedProperties() ) { // this entity defines proeprty generation, so process those generated // values... persister.processUpdateGeneratedProperties( id, instance, state, session ); if ( persister.isVersionPropertyGenerated() ) { nextVersion = Versioning.getVersion( state, persister ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/EntityInsertAction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/EntityUpdateAction.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 5 Number of AST nodes: 4
1
if ( persister.hasInsertGeneratedProperties() ) {
1
if ( persister.hasUpdateGeneratedProperties() ) {
2
				persister.processInsert
2
				// this entity defines proeprty generation, so process those generated
3
				// values...
3
GeneratedProperties( id, instance, state, session );
4
				persister.processUpdateGeneratedProperties( id, instance, state, session );
4
				if ( persister.isVersionPropertyGenerated() ) {
5
				if ( persister.isVersionPropertyGenerated() ) {
5
					version = Versioning.getVersion(state, persister);
6
					nextVersion = Versioning.getVersion( state, persister );
6
				}
7
				}
7
				entry.postUpdate(instance, state, version);
8
			
8
			}
9
}
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    12
    if (persister.hasInsertGeneratedProperties())
    12
    if (persister.hasInsertGeneratedProperties())
    22
    if (persister.hasUpdateGeneratedProperties())
    Differences
    Expression1Expression2Difference
    hasInsertGeneratedPropertieshasUpdateGeneratedPropertiesMETHOD_INVOCATION_NAME_MISMATCH
    22
    if (persister.hasUpdateGeneratedProperties())
    13
    persister.processInsertGeneratedProperties(id, instance, state, session);
    13
    persister.processInsertGeneratedProperties(id, instance, state, session);
    23
    persister.processUpdateGeneratedProperties(id, instance, state, session);
    Differences
    Expression1Expression2Difference
    processInsertGeneratedPropertiesprocessUpdateGeneratedPropertiesMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression persister.processInsertGeneratedProperties(id,instance,state,session) is a void method call, and thus it cannot be parameterized
    Expression persister.processUpdateGeneratedProperties(id,instance,state,session) is a void method call, and thus it cannot be parameterized
    23
    persister.processUpdateGeneratedProperties(id, instance, state, session);
    14
    if (persister.isVersionPropertyGenerated())
    24
    if (persister.isVersionPropertyGenerated())
    15
    version = Versioning.getVersion(state, persister);
    15
    version = Versioning.getVersion(state, persister);
    25
    nextVersion = Versioning.getVersion(state, persister);
    Differences
    Expression1Expression2Difference
    versionnextVersionVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression version is a field being modified, and thus it cannot be parameterized
    Expression nextVersion is a field being modified, and thus it cannot be parameterized
    25
    nextVersion = Versioning.getVersion(state, persister);
    16
    entry.postUpdate(instance, state, version);
                                                                                              
    Precondition Violations (4)
    Row Violation
    1Expression persister.processInsertGeneratedProperties(id,instance,state,session) is a void method call, and thus it cannot be parameterized
    2Expression persister.processUpdateGeneratedProperties(id,instance,state,session) is a void method call, and thus it cannot be parameterized
    3Expression version is a field being modified, and thus it cannot be parameterized
    4Expression nextVersion is a field being modified, and thus it cannot be parameterized