boolean include = includeOldField[i] && isPropertyOfTable( i, j ) && versionability[i]; //TODO: is this really necessary???? if ( include ) { boolean[] settable = types[i].toColumnNullness( oldFields[i], getFactory() ); types[i].nullSafeSet( update, oldFields[i], index, settable, session ); index += ArrayHelper.countTrue(settable); }
for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) { if ( isPropertyOfTable( i, j ) && versionability[i] ) { // this property belongs to the table and it is not specifically // excluded from optimistic locking by optimistic-lock="false" boolean[] settable = types[i].toColumnNullness( loadedState[i], getFactory() ); types[i].nullSafeSet( delete, loadedState[i], index, settable, session ); index += ArrayHelper.countTrue( settable ); } }
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: boolean update(Serializable, Object[], Object[], Object, boolean[], int, Object, Object, String, SessionImplementor) Method name: void delete(Serializable, Object, int, Object, String, SessionImplementor, Object[])
Number of AST nodes: 5 Number of AST nodes: 5
1
boolean include = includeOldField[i] &&
1
for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
2
								isPropertyOfTable( i, j ) &&
2
						if ( isPropertyOfTable( i, j ) &&
3
								versionability[i]; //TODO: is this really necessary????
3
 versionability[i]
4
						if ( include ) {
4
 ) {
5
							// this property belongs to the table and it is not specifically
6
							// excluded from optimistic locking by optimistic-lock="false"
5
							boolean[] settable = types[i].toColumnNullness( oldFields[i], getFactory() );
7
							boolean[] settable = types[i].toColumnNullness( loadedState[i], getFactory() );
6
							types[i].nullSafeSet(
8
							types[i].nullSafeSet(
7
									update,
8
									oldFields[i],
9
									index,
10
									settable,
11
									session
12
								);
9
 delete, loadedState[i], index, settable, session );
13
							index += ArrayHelper.countTrue(settable);
10
							index += ArrayHelper.countTrue( settable );
14
						}
11
						}
12
					}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons1