if ( affectedEntityNames != null ) { Iterator itr = affectedEntityNames.iterator(); while ( itr.hasNext() ) { final String entityName = ( String ) itr.next(); session.getFactory().evictEntity( entityName ); } }
if ( mappingInfo.hasSubclasses() ) { Iterator itr = mappingInfo.getSubclassClosureIterator(); while ( itr.hasNext() ) { final PersistentClass subclassInfo = ( PersistentClass ) itr.next(); isInstanceNodeNames.add( subclassInfo.getNodeName() ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/BulkOperationCleanupAction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/tuple/Dom4jInstantiator.java
Method name: void evictEntityRegions() Method name: void Dom4jInstantiator(PersistentClass)
Number of AST nodes: 5 Number of AST nodes: 5
1
if ( affectedEntityNames != null ) {
1
if ( 
2
			Iterator itr = affectedEntityNames.i
2
mappingInfo.hasSubclasses() ) {
3
terator();
3
			Iterator itr = mappingInfo.getSubclassClosureIterator();
4
			while ( itr.hasNext() ) {
4
			while ( itr.hasNext() ) {
5
				final String entityName = ( String ) itr.next();
5
				final 
6
				session.getFactory().evictEntity( entity
6
PersistentClass subclassInfo = ( PersistentClass ) itr.next();
7
Name );
7
				isInstanceNodeNames.add( subclassInfo.getNodeName() );
8
			}
8
			}
9
		}
9
		}
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 comparisons11
  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 fragment3
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    Iterator itr = affectedEntityNames.iterator();
                                                                                                  
                                                                                                                      
    4
    Iterator itr = mappingInfo.getSubclassClosureIterator();
    3
    while (itr.hasNext())
    5
    while (itr.hasNext())
    4
    final String entityName = (String)itr.next();
    4
    final String entityName = (String)itr.next();
    Preondition Violations
    Unmatched statement final String entityName=(String)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    5
    session.getFactory().evictEntity(entityName);
                                                                                                    
                                                                                                                                        
    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
    isInstanceNodeNames.add(subclassInfo.getNodeName());
    Precondition Violations (2)
    Row Violation
    1Unmatched statement final String entityName=(String)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched 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