for ( int j = 0; j < span; j++ ) { // Now update only the tables with dirty properties (and the table with the version number) if ( tableUpdateNeeded[j] ) { updateOrInsert( id, fields, oldFields, j == 0 ? rowId : null, propsToUpdate, j, oldVersion, object, updateStrings[j], session ); } }
for ( int i = 0; i < types.length; i++ ) { if ( includeProperty[i] ) { values[i] = types[i].hydrate( rs, getPropertyAliases( "", i ), session, null ); //null owner ok?? } }
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: void update(Serializable, Object[], int[], boolean, Object[], Object, Object, Object, SessionImplementor) Method name: Object[] getDatabaseSnapshot(Serializable, SessionImplementor)
Number of AST nodes: 3 Number of AST nodes: 3
1
for ( int j = 0; j < span; j++ ) {
1
for ( int i = 0; i < types.length; i++ ) {
2
			// Now update only the tables with dirty properties (and the table with the ver
2
						if ( includeProperty[i] ) {
3
sion number)
3
							values[i] = types[i].hydrate( rs, getPropertyAliases( "", i ), session, nu
4
			if ( tableUpdateNeeded[j] ) {
5
				updateOrInsert(
6
						id,
7
						fields,
8
						oldFields,
9
						j == 0 ? rowId : null,
10
						propsToUpdate,
11
						j,
12
						oldVersion,
13
						object,
14
						updateStrings[j],
15
						session
16
					);
17
			}
4
ll ); //null owner ok??
5
						}
18
		}
6
					}
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.3
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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
    12
    for (int j = 0; j < span; j++)
    12
    for (int j = 0; j < span; j++)
    14
    for (int i = 0; i < types.length; i++)
    Differences
    Expression1Expression2Difference
    jiVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    spantypes.lengthTYPE_COMPATIBLE_REPLACEMENT
    jiVARIABLE_NAME_MISMATCH
    14
    for (int i = 0; i < types.length; i++)
    13
    if (tableUpdateNeeded[j])
    13
    if (tableUpdateNeeded[j])
    15
    if (includeProperty[i])
    Differences
    Expression1Expression2Difference
    tableUpdateNeededincludePropertyVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    15
    if (includeProperty[i])
    14
    updateOrInsert(id, fields, oldFields, j == 0 ? rowId : null, propsToUpdate, j, oldVersion, object, updateStrings[j], session);
    14
    updateOrInsert(id, fields, oldFields, j == 0 ? rowId : null, propsToUpdate, j, oldVersion, object, updateStrings[j], session);
    Preondition Violations
    Unmatched statement updateOrInsert(id,fields,oldFields,j == 0 ? rowId : null,propsToUpdate,j,oldVersion,object,updateStrings[j],session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                      
                                                                                                                                                      
    16
    values[i] = types[i].hydrate(rs, getPropertyAliases("", i), session, null);
    Preondition Violations
    Unmatched statement values[i]=types[i].hydrate(rs,getPropertyAliases("",i),session,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16
    values[i] = types[i].hydrate(rs, getPropertyAliases("", i), session, null);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement updateOrInsert(id,fields,oldFields,j == 0 ? rowId : null,propsToUpdate,j,oldVersion,object,updateStrings[j],session); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement values[i]=types[i].hydrate(rs,getPropertyAliases("",i),session,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted