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 < entityMetamodel.getPropertySpan(); i++ ) { if ( propertyUniqueness[i] ) { //don't need filters for the static loaders uniqueKeyLoaders.put( propertyNames[i], createUniqueKeyLoader( propertyTypes[i], getPropertyColumnNames( i ), CollectionHelper.EMPTY_MAP ) ); //TODO: create uk loaders for component properties } }
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: void createUniqueKeyLoaders()
Number of AST nodes: 3 Number of AST nodes: 3
1
for ( int j = 0; j < span; j++ ) {
1
for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
2
			// Now update only the tables with dirty properties (and the table with the version number)
2
			
3
			if ( tableUpdateNeeded[j] ) {
4
				updateOrInsert(
5
						id,
6
						fields,
7
						oldFields,
8
						j == 0 ? rowId : null,
9
						propsToUpdate,
10
						j,
11
						oldVersion,
12
						object,
13
						updateStrings[j],
14
						session
15
					);
3
if ( propertyUniqueness[i] ) {
4
				//don't need filters for the static loaders
5
				uniqueKeyLoaders.put(
6
						propertyNames[i],
7
						createUniqueKeyLoader(
8
								propertyTypes[i],
9
								getPropertyColumnNames( i ),
10
								CollectionHelper.EMPTY_MAP
11
							)
12
					);
13
				//TODO: create uk loaders for component properties
16
			}
14
			}
17
		}
15
		}
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++)
    3
    for (int i = 0; i < entityMetamodel.getPropertySpan(); i++)
    Differences
    Expression1Expression2Difference
    jiVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    spanentityMetamodel.getPropertySpan()TYPE_COMPATIBLE_REPLACEMENT
    jiVARIABLE_NAME_MISMATCH
    3
    for (int i = 0; i < entityMetamodel.getPropertySpan(); i++)
    13
    if (tableUpdateNeeded[j])
    13
    if (tableUpdateNeeded[j])
    4
    if (propertyUniqueness[i])
    Differences
    Expression1Expression2Difference
    tableUpdateNeededpropertyUniquenessVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    4
    if (propertyUniqueness[i])
                                                                                                                                                                                                                                                                                  
    5
    uniqueKeyLoaders.put(propertyNames[i], createUniqueKeyLoader(propertyTypes[i], getPropertyColumnNames(i), CollectionHelper.EMPTY_MAP));
    Preondition Violations
    Unmatched statement uniqueKeyLoaders.put(propertyNames[i],createUniqueKeyLoader(propertyTypes[i],getPropertyColumnNames(i),CollectionHelper.EMPTY_MAP)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    uniqueKeyLoaders.put(propertyNames[i], createUniqueKeyLoader(propertyTypes[i], getPropertyColumnNames(i), CollectionHelper.EMPTY_MAP));
    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
                                                                                                                                                                                                                                                      
    Precondition Violations (2)
    Row Violation
    1Unmatched statement uniqueKeyLoaders.put(propertyNames[i],createUniqueKeyLoader(propertyTypes[i],getPropertyColumnNames(i),CollectionHelper.EMPTY_MAP)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched 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