if ( copy[i] ) { if ( values[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY || values[i] == BackrefPropertyAccessor.UNKNOWN ) { target[i] = values[i]; } else { target[i] = types[i].deepCopy( values[i], session.getEntityMode(), session .getFactory() ); } }
for ( int i = 0; i < types.length; i++ ) { if ( row[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY || row[i] == BackrefPropertyAccessor.UNKNOWN ) { assembled[i] = row[i]; } else { assembled[i] = types[i].assemble( row[i], session, owner ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/TypeFactory.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/TypeFactory.java
Method name: void deepCopy(Object[], Type[], boolean[], Object[], SessionImplementor) Method name: Object[] assemble(Serializable[], Type[], SessionImplementor, Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( copy[i] ) {
1
for ( int i = 0; i < types.length; i++ ) {
2
				if ( values[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY
2
			if ( row[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY
3
					|| values[i] == BackrefPropertyAccessor.UNKNOWN ) {
3
 || row[i] == BackrefPropertyAccessor.UNKNOWN ) {
4
					target[i] = values[i];
4
				assembled[i] = row[i];
5
				}
5
			}
6
				else {
6
			else {
7
					target[i] = types[i].deepCopy( values[i], session.getEntityMode(), session
7
				assembled[i] = types[i].
8
						.getFactory() );
8
assemble( row[i], session, owner );
9
				}
9
			}
10
			}
10
		}
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 comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (values[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY || values[i] == BackrefPropertyAccessor.UNKNOWN)
    3
    if (values[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY || values[i] == BackrefPropertyAccessor.UNKNOWN)
    3
    if (row[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY || row[i] == BackrefPropertyAccessor.UNKNOWN)
    Differences
    Expression1Expression2Difference
    valuesrowVARIABLE_NAME_MISMATCH
    java.lang.Object[]java.io.Serializable[]VARIABLE_TYPE_MISMATCH
    valuesrowVARIABLE_NAME_MISMATCH
    java.lang.Object[]java.io.Serializable[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object[] of variable values does not match with type java.io.Serializable[] of variable row
    • Make classes java.lang.Object[] and java.io.Serializable[] extend a common superclass
    Type java.lang.Object[] of variable values does not match with type java.io.Serializable[] of variable row
    • Make classes java.lang.Object[] and java.io.Serializable[] extend a common superclass
    3
    if (row[i] == LazyPropertyInitializer.UNFETCHED_PROPERTY || row[i] == BackrefPropertyAccessor.UNKNOWN)
                                                  
    4
    assembled[i] = row[i];
    Preondition Violations
    Unmatched statement assembled[i]=row[i]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    assembled[i] = row[i];
    4
    target[i] = values[i];
    4
    target[i] = values[i];
    Preondition Violations
    Unmatched statement target[i]=values[i]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                  
    else
            
                                                                                                                    
    5
    assembled[i] = types[i].assemble(row[i], session, owner);
    Preondition Violations
    Unmatched statement assembled[i]=types[i].assemble(row[i],session,owner); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    assembled[i] = types[i].assemble(row[i], session, owner);
    5
    target[i] = types[i].deepCopy(values[i], session.getEntityMode(), session.getFactory());
    5
    target[i] = types[i].deepCopy(values[i], session.getEntityMode(), session.getFactory());
    Preondition Violations
    Unmatched statement target[i]=types[i].deepCopy(values[i],session.getEntityMode(),session.getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                  
    Precondition Violations (6)
    Row Violation
    1Type java.lang.Object[] of variable values does not match with type java.io.Serializable[] of variable row
    2Type java.lang.Object[] of variable values does not match with type java.io.Serializable[] of variable row
    3Unmatched statement assembled[i]=row[i]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement target[i]=values[i]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement assembled[i]=types[i].assemble(row[i],session,owner); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement target[i]=types[i].deepCopy(values[i],session.getEntityMode(),session.getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted