while ( itr.hasNext() ) { Map.Entry entry = ( Map.Entry ) itr.next(); ( ( EntityKey ) entry.getKey() ).serialize( oos ); oos.writeObject( entry.getValue() ); }
while ( iter.hasNext() ) { cols.clear(); Join join = (Join) iter.next(); checkColumnDuplication( cols, join.getKey().getColumnIterator() ); checkPropertyColumnDuplication( cols, join.getPropertyIterator() ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/StatefulPersistenceContext.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/PersistentClass.java
Method name: void serialize(ObjectOutputStream) Method name: void checkColumnDuplication()
Number of AST nodes: 4 Number of AST nodes: 5
1
while ( itr.hasNext() ) {
1
while ( iter.hasNext() ) {
2
			Map.Entry entry = ( Map.Entry 
2
			cols.clear();
3
) itr.next();
3
			Join join = (Join) iter.next();
4
			( ( EntityKey ) entry.getKey() ).serialize( oos );
4
			
5
			oos.writeObject( entry.getValue
5
checkColumnDuplication( cols, join.getKey().getColumnIterator() );
6
() );
6
			checkPropertyColumnDuplication( cols, join.getPropertyIterator() );
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 comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)3.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    20
    while (itr.hasNext())
    20
    while (itr.hasNext())
    7
    while (iter.hasNext())
    Differences
    Expression1Expression2Difference
    itriterVARIABLE_NAME_MISMATCH
    7
    while (iter.hasNext())
                                    
    8
    cols.clear();
                                                                  
    9
    Join join = (Join)iter.next();
    Preondition Violations
    Unmatched statement Join join=(Join)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    Join join = (Join)iter.next();
                                                                                                                                          
    10
    checkColumnDuplication(cols, join.getKey().getColumnIterator());
    Preondition Violations
    Unmatched statement checkColumnDuplication(cols,join.getKey().getColumnIterator()); 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
    10
    checkColumnDuplication(cols, join.getKey().getColumnIterator());
                                                                                                                                            
    11
    checkPropertyColumnDuplication(cols, join.getPropertyIterator());
    Preondition Violations
    Unmatched statement checkPropertyColumnDuplication(cols,join.getPropertyIterator()); 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
    11
    checkPropertyColumnDuplication(cols, join.getPropertyIterator());
    21
    Map.Entry entry = (Map.Entry)itr.next();
    21
    Map.Entry entry = (Map.Entry)itr.next();
    Preondition Violations
    Unmatched statement Map.Entry entry=(Map.Entry)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                        
    22
    ((EntityKey)entry.getKey()).serialize(oos);
    22
    ((EntityKey)entry.getKey()).serialize(oos);
    Preondition Violations
    Unmatched statement ((EntityKey)entry.getKey()).serialize(oos); 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
                                                                                                  
    23
    oos.writeObject(entry.getValue());
    23
    oos.writeObject(entry.getValue());
    Preondition Violations
    Unmatched statement oos.writeObject(entry.getValue()); 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
                                                                                
    Precondition Violations (7)
    Row Violation
    1Unmatched statement Join join=(Join)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement checkColumnDuplication(cols,join.getKey().getColumnIterator()); 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
    3Unmatched statement checkPropertyColumnDuplication(cols,join.getPropertyIterator()); 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 Map.Entry entry=(Map.Entry)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement ((EntityKey)entry.getKey()).serialize(oos); 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
    6Unmatched statement oos.writeObject(entry.getValue()); 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
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero