Table table = (Table) titer.next(); if ( !table.isAbstractUnionTable() ) { Iterator citer = table.getColumnIterator(); while ( citer.hasNext() ) columns.add( citer.next() ); }
if ( mappingInfo.hasSubclasses() ) { Iterator itr = mappingInfo.getSubclassClosureIterator(); while ( itr.hasNext() ) { final PersistentClass subclassInfo = ( PersistentClass ) itr.next(); isInstanceEntityNames.add( subclassInfo.getEntityName() ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/DynamicMapInstantiator.java
Method name: String generateSubquery(PersistentClass, Mapping) Method name: void DynamicMapInstantiator(PersistentClass)
Number of AST nodes: 5 Number of AST nodes: 5
1
Table table = (Table) titer.next();
2
			if ( !table.isAbstractUnionTable() ) {
1
if ( mappingInfo.hasSubclasses() ) {
3
				Iterator citer = table.getColumnIterator();
2
			Iterator itr = mappingInfo.getSubclassClosureIterator();
4
				while ( citer.hasNext() ) columns.add( citer.next
3
			while ( itr.hasNext() ) {
4
				final PersistentClass subclassInfo = ( PersistentClass ) itr.next();
5
() );
5
				isInstanceEntityNames.add( subclassInfo.getEntityName() );
6
			}
6
			}
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.2
Clones locationClones are in different classes
Number of node comparisons10
  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)34.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    8
    Table table = (Table)titer.next();
    8
    Table table = (Table)titer.next();
    Preondition Violations
    Unmatched statement Table table=(Table)titer.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                          
    9
    if (!table.isAbstractUnionTable())
    9
    if (!table.isAbstractUnionTable())
    3
    if (mappingInfo.hasSubclasses())
    Differences
    Expression1Expression2Difference
    !table.isAbstractUnionTable()mappingInfo.hasSubclasses()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression !table.isAbstractUnionTable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (mappingInfo.hasSubclasses())
                                                                                                                      
    4
    Iterator itr = mappingInfo.getSubclassClosureIterator();
    Preondition Violations
    Unmatched statement Iterator itr=mappingInfo.getSubclassClosureIterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    Iterator itr = mappingInfo.getSubclassClosureIterator();
    10
    Iterator citer = table.getColumnIterator();
    10
    Iterator citer = table.getColumnIterator();
    Preondition Violations
    Unmatched statement Iterator citer=table.getColumnIterator(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    11
    while (citer.hasNext())
    11
    while (citer.hasNext())
    5
    while (itr.hasNext())
    Differences
    Expression1Expression2Difference
    citeritrVARIABLE_NAME_MISMATCH
    5
    while (itr.hasNext())
                                                                                                                                        
    6
    final PersistentClass subclassInfo = (PersistentClass)itr.next();
    Preondition Violations
    Unmatched statement final PersistentClass subclassInfo=(PersistentClass)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    final PersistentClass subclassInfo = (PersistentClass)itr.next();
                                                                                                                          
    7
    isInstanceEntityNames.add(subclassInfo.getEntityName());
    12
    columns.add(citer.next());
                                                                
    Precondition Violations (6)
    Row Violation
    1Unmatched statement Table table=(Table)titer.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression !table.isAbstractUnionTable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement Iterator itr=mappingInfo.getSubclassClosureIterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement Iterator citer=table.getColumnIterator(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement final PersistentClass subclassInfo=(PersistentClass)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6The refactoring of the clones is infeasible, because classes org.hibernate.persister.entity.UnionSubclassEntityPersister and org.hibernate.tuple.DynamicMapInstantiator do not have a common superclass