while ( iter.hasNext() ) { // NativeSQL: collect key column and auto-aliases Column col = ( (Column) iter.next() ); keyColumnNames[k] = col.getQuotedName(dialect); keyColumnAliases[k] = col.getAlias(dialect); k++; }
while ( itr.hasNext() ) { Property property = ( Property ) itr.next(); properties[i] = PropertyFactory.buildStandardProperty( property, false ); propertyIndexes.put( property.getName(), new Integer( i ) ); i++; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/component/ComponentMetamodel.java
Method name: void AbstractCollectionPersister(Collection, CollectionRegionAccessStrategy, Configuration, SessionFactoryImplementor) Method name: void ComponentMetamodel(Component)
Number of AST nodes: 5 Number of AST nodes: 5
1
while ( iter.hasNext() ) {
1
while ( itr.hasNext() ) {
2
			// NativeSQL: collect key column and auto-aliases
2
			
3
			Column col = ( (Column) iter.next() );
3
Property property = ( Property ) itr.next();
4
			keyColumnNames[k] = col.getQuotedName(dialect);
4
			properties[i] = PropertyFactory.buildStandardProperty( property, false );
5
			keyColumnAliases[k] = col.getAlias(dialect);
5
			propertyIndexes.put( property.getName(), new Integer( i ) );
6
			k++;
6
			i++;
7
		}
7
		}
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.1
Clones locationClones are in different classes
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)8.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    46
    while (iter.hasNext())
    46
    while (iter.hasNext())
    7
    while (itr.hasNext())
    Differences
    Expression1Expression2Difference
    iteritrVARIABLE_NAME_MISMATCH
    7
    while (itr.hasNext())
                                                                                        
    8
    Property property = (Property)itr.next();
    Preondition Violations
    Unmatched statement Property property=(Property)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    Property property = (Property)itr.next();
                                                                                                                                                  
    9
    properties[i] = PropertyFactory.buildStandardProperty(property, false);
    Preondition Violations
    Unmatched statement properties[i]=PropertyFactory.buildStandardProperty(property,false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement properties[i]=PropertyFactory.buildStandardProperty(property,false); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    9
    properties[i] = PropertyFactory.buildStandardProperty(property, false);
                                                                                                                          
    10
    propertyIndexes.put(property.getName(), new Integer(i));
    Preondition Violations
    Unmatched statement propertyIndexes.put(property.getName(),new Integer(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10
    propertyIndexes.put(property.getName(), new Integer(i));
    47
    Column col = ((Column)iter.next());
    47
    Column col = ((Column)iter.next());
    Preondition Violations
    Unmatched statement Column col=((Column)iter.next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
    48
    keyColumnNames[k] = col.getQuotedName(dialect);
    48
    keyColumnNames[k] = col.getQuotedName(dialect);
    Preondition Violations
    Unmatched statement keyColumnNames[k]=col.getQuotedName(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                      
    49
    keyColumnAliases[k] = col.getAlias(dialect);
    49
    keyColumnAliases[k] = col.getAlias(dialect);
    Preondition Violations
    Unmatched statement keyColumnAliases[k]=col.getAlias(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    50
    k++;
    50
    k++;
    11
    i++;
    Differences
    Expression1Expression2Difference
    kiVARIABLE_NAME_MISMATCH
    11
    i++;
    Precondition Violations (8)
    Row Violation
    1Unmatched statement Property property=(Property)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement properties[i]=PropertyFactory.buildStandardProperty(property,false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement properties[i]=PropertyFactory.buildStandardProperty(property,false); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    4Unmatched statement propertyIndexes.put(property.getName(),new Integer(i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement Column col=((Column)iter.next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement keyColumnNames[k]=col.getQuotedName(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement keyColumnAliases[k]=col.getAlias(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8The refactoring of the clones is infeasible, because classes org.hibernate.persister.collection.AbstractCollectionPersister and org.hibernate.tuple.component.ComponentMetamodel do not have a common superclass