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 } }
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 createUniqueKeyLoaders() Method name: Object[] getDatabaseSnapshot(Serializable, SessionImplementor)
Number of AST nodes: 3 Number of AST nodes: 3
1
for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
1
for ( int i = 0; i < types.length; i++ ) {
2
			if ( propertyUniqueness[i] ) {
2
						if ( 
3
				//don't need filters for the static loaders
4
				uniqueKeyLoaders.put(
5
						propertyNames[i],
6
						createUniqueKeyLoader(
7
								propertyTypes[i],
8
								getPropertyColumnNames( i ),
9
								CollectionHelper.EMPTY_MAP
10
							)
11
					);
12
				//TODO: create uk loaders for component properties
13
			}
3
includeProperty[i] ) {
4
							values[i] = types[i].hydrate( rs, getPropertyAliases( "", i ), session, null ); //null owner ok??
5
						}
14
		}
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)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    for (int i = 0; i < entityMetamodel.getPropertySpan(); i++)
    3
    for (int i = 0; i < entityMetamodel.getPropertySpan(); i++)
    14
    for (int i = 0; i < types.length; i++)
    Differences
    Expression1Expression2Difference
    entityMetamodel.getPropertySpan()types.lengthTYPE_COMPATIBLE_REPLACEMENT
    14
    for (int i = 0; i < types.length; i++)
    4
    if (propertyUniqueness[i])
    4
    if (propertyUniqueness[i])
    15
    if (includeProperty[i])
    Differences
    Expression1Expression2Difference
    propertyUniquenessincludePropertyVARIABLE_NAME_MISMATCH
    15
    if (includeProperty[i])
    5
    uniqueKeyLoaders.put(propertyNames[i], createUniqueKeyLoader(propertyTypes[i], getPropertyColumnNames(i), CollectionHelper.EMPTY_MAP));
    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
                                                                                                                                                                                                                                                                                  
                                                                                                                                                      
    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 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 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