public static int[] findDirty( final StandardProperty[] properties, final Object[] currentState, final Object[] previousState, final boolean[][] includeColumns, final boolean anyUninitializedProperties, final SessionImplementor session) { int[] results = null; int count = 0; int span = properties.length; for ( int i = 0; i < span; i++ ) { final boolean dirty = currentState[i] != LazyPropertyInitializer.UNFETCHED_PROPERTY && properties[i].isDirtyCheckable( anyUninitializedProperties ) && properties[i].getType().isDirty( previousState[i], currentState[i], includeColumns[i], session ); if ( dirty ) { if ( results == null ) { results = new int[span]; } results[count++] = i; } } if ( count == 0 ) { return null; } else { int[] trimmed = new int[count]; System.arraycopy( results, 0, trimmed, 0, count ); return trimmed;
public static int[] findModified( final StandardProperty[] properties, final Object[] currentState, final Object[] previousState, final boolean[][] includeColumns, final boolean anyUninitializedProperties, final SessionImplementor session) { int[] results = null; int count = 0; int span = properties.length; for ( int i = 0; i < span; i++ ) { final boolean modified = currentState[i]!=LazyPropertyInitializer.UNFETCHED_PROPERTY && properties[i].isDirtyCheckable(anyUninitializedProperties) && properties[i].getType().isModified( previousState[i], currentState[i], includeColumns[i], session ); if ( modified ) { if ( results == null ) { results = new int[span]; } results[count++] = i; } } if ( count == 0 ) { return null; } else { int[] trimmed = new int[count]; System.arraycopy( results, 0, trimmed, 0, count ); return trimmed;
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public static int[] findDirty(
1
public static int[] findModified(
2
			final StandardProperty[] properties,
2
			final StandardProperty[] properties, 
3
			final Object[] currentState,
3
			final Object[] currentState,
4
			final Object[] previousState,
4
			final Object[] previousState,
5
			final boolean[][] includeColumns,
5
			final boolean[][] includeColumns,
6
			final boolean anyUninitializedProperties,
6
			final boolean anyUninitializedProperties,
7
			final SessionImplementor session) {
7
			final SessionImplementor session) {
8
		int[] results = null;
8
		int[] results = null;
9
		int count = 0;
9
		int count = 0;
10
		int span = properties.length;
10
		int span = properties.length;
11
		for ( int i = 0; i < span; i++ ) {
11
		for ( int i = 0; i < span; i++ ) {
12
			final boolean dirty = currentState[i] != LazyPropertyInitializer.UNFETCHED_PROPERTY
12
			final boolean modified = currentState[i]!=LazyPropertyInitializer.UNFETCHED_PROPERTY
13
					&& properties[i].isDirtyCheckable( anyUninitializedProperties )
13
					&& properties[i].isDirtyCheckable(anyUninitializedProperties)
14
					&& properties[i].getType().isDirty( previousState[i], currentState[i], includeColumns[i], session );
14
					&& properties[i].getType().isModified( previousState[i], currentState[i], includeColumns[i], session );
15
			if ( dirty ) {
15
			if ( modified ) {
16
				if ( results == null ) {
16
				if ( results == null ) {
17
					results = new int[span];
17
					results = new int[span];
18
				}
18
				}
19
				results[count++] = i;
19
				results[count++] = i;
20
			}
20
			}
21
		}
21
		}
22
		if ( count == 0 ) {
22
		if ( count == 0 ) {
23
			return null;
23
			return null;
24
		}
24
		}
25
		else {
25
		else {
26
			int[] trimmed = new int[count];
26
			int[] trimmed = new int[count];
27
			System.arraycopy( results, 0, trimmed, 0, count );
27
			System.arraycopy( results, 0, trimmed, 0, count );
28
			return trimmed;
28
			return trimmed;
29
		
29
		
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.0
Clones location
Number of node comparisons0