boolean include = includeInWhere[i] && isPropertyOfTable( i, j ) && versionability[i]; if ( include ) { // this property belongs to the table, and it is not specifically // excluded from optimistic locking by optimistic-lock="false" String[] propertyColumnNames = getPropertyColumnNames( i ); boolean[] propertyNullness = types[i].toColumnNullness( oldFields[i], getFactory() ); for ( int k=0; k<propertyNullness.length; k++ ) { if ( propertyNullness[k] ) { update.addWhereColumn( propertyColumnNames[k] ); } else { update.addWhereColumn( propertyColumnNames[k], " is null" ); } } }
boolean[] versionability = getPropertyVersionability(); Type[] types = getPropertyTypes(); 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: String generateUpdateString(boolean[], int, Object[], boolean) Method name: void delete(Serializable, Object, int, Object, String, SessionImplementor, Object[])
Number of AST nodes: 8 Number of AST nodes: 7
1
boolean include = includeInWhere[i] &&
1
boolean[] versionability = getPropertyVersionability();
2
					Type[] types = getPropertyTypes();
3
					for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
2
						isPropertyOfTable( i, j ) &&
4
						if ( isPropertyOfTable( i, j ) &&
3
						versionability[i];
5
 versionability[i]
4
				if ( include ) {
6
 ) {
5
					// this property belongs to the table, and it is not specifically
7
							// this property belongs to the table and it is not specifically
6
					// excluded from optimistic locking by optimistic-lock="false"
8
							// excluded from optimistic locking by optimistic-lock="false"
7
					String[] propertyColumnNames = getPropertyColumnNames( i );
9
					
8
					boolean[] propertyNullness = types[i].toColumnNullness( oldFields[i], getFactory() );
10
		boolean[] settable = types[i].toColumnNullness( loadedState[i], getFactory() );
9
					for ( int k=0; k<propertyNullness.length; k++ ) {
11
					
10
						if ( propertyNullness[k] ) {
11
							update.addWhereColumn( propertyColumnNames[k] );
12
						}
13
						else {
14
							update.addWhereColumn( propertyColumnNames[k], " is null"
12
		types[i].nullSafeSet( delete, loadedState[i], index, settable, session );
15
 );
13
							index += ArrayHelper.countTrue( settable );
16
						}
14
						}
17
					}
15
					}
18
				}
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