for ( int j = 0; j < lazyPropertyNames.length; j++ ) { final Object propValue = lazyPropertyTypes[j].assemble( disassembledValues[ lazyPropertyNumbers[j] ], session, entity ); if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) { result = propValue; } }
for ( int j = 0; j < lazyPropertyNames.length; j++ ) { Object propValue = lazyPropertyTypes[j].nullSafeGet( rs, lazyPropertyColumnAliases[j], session, entity ); if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) { result = propValue; } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
Method name: Object initializeLazyPropertiesFromCache(String, Object, SessionImplementor, EntityEntry, CacheEntry) Method name: Object initializeLazyPropertiesFromDatastore(String, Object, SessionImplementor, Serializable, EntityEntry)
Number of AST nodes: 4 Number of AST nodes: 4
1
for ( int j = 0; j < lazyPropertyNames.length; j++ ) {
1
for ( int j = 0; j < lazyPropertyNames.length; j++ ) {
2
			final Object propValue = lazyPropertyTypes[j].assemble(
2
						Object propValue = lazyPropertyTypes[j].
3
					disassembledValues[ lazyPropertyNumbers[j] ],
3
nullSafeGet( rs, lazyProperty
4
					session,
4
ColumnAliases[j], session,
5
					entity
5
 entity );
6
				);
6
				
7
			if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {
7
		if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {
8
				result = propValue;
8
							result = propValue;
9
			}
9
			
10
			}
10
		}
11
					}
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.4
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    for (int j = 0; j < lazyPropertyNames.length; j++)
    17
    for (int j = 0; j < lazyPropertyNames.length; j++)
    6
    final Object propValue = lazyPropertyTypes[j].assemble(disassembledValues[lazyPropertyNumbers[j]], session, entity);
    6
    final Object propValue = lazyPropertyTypes[j].assemble(disassembledValues[lazyPropertyNumbers[j]], session, entity);
    Preondition Violations
    Unmatched statement final Object propValue=lazyPropertyTypes[j].assemble(disassembledValues[lazyPropertyNumbers[j]],session,entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                          
                                                                                                                                                                                                                
    18
    Object propValue = lazyPropertyTypes[j].nullSafeGet(rs, lazyPropertyColumnAliases[j], session, entity);
    Preondition Violations
    Unmatched statement Object propValue=lazyPropertyTypes[j].nullSafeGet(rs,lazyPropertyColumnAliases[j],session,entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18
    Object propValue = lazyPropertyTypes[j].nullSafeGet(rs, lazyPropertyColumnAliases[j], session, entity);
    7
    if (initializeLazyProperty(fieldName, entity, session, snapshot, j, propValue))
    19
    if (initializeLazyProperty(fieldName, entity, session, snapshot, j, propValue))
    8
    result = propValue;
    20
    result = propValue;
    Precondition Violations (3)
    Row Violation
    1Unmatched statement final Object propValue=lazyPropertyTypes[j].assemble(disassembledValues[lazyPropertyNumbers[j]],session,entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Object propValue=lazyPropertyTypes[j].nullSafeGet(rs,lazyPropertyColumnAliases[j],session,entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables j, result , while Clone fragment #2 returns variables j, result