Iterator itr = files.iterator(); while ( itr.hasNext() ) { final File file = ( File ) itr.next(); collectClassNames( file, classNames ); }
if ( affectedEntityNames != null ) { Iterator itr = affectedEntityNames.iterator(); while ( itr.hasNext() ) { final String entityName = ( String ) itr.next(); session.getFactory().evictEntity( entityName ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/buildtime/AbstractInstrumenter.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/BulkOperationCleanupAction.java
Method name: void execute(Set) Method name: void evictEntityRegions()
Number of AST nodes: 4 Number of AST nodes: 5
1
Iterator itr = fil
1
if ( affectedEntityNames != null ) {
2
es.iterator();
2
			Iterator itr = affectedEntityNames.iterator();
3
				while ( itr.hasNext() ) {
3
			while ( itr.hasNext() ) {
4
					final File file = ( File ) itr.next();
4
				final 
5
					collectClassNames( file, class
5
String entityName = ( String ) itr.next();
6
Names );
6
				session.getFactory().evictEntity( entityName );
7
			
7
			}
8
	}
8
		}
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 statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    Iterator itr = files.iterator();
    5
    Iterator itr = files.iterator();
    2
    Iterator itr = affectedEntityNames.iterator();
    Differences
    Expression1Expression2Difference
    filesaffectedEntityNamesVARIABLE_NAME_MISMATCH
    2
    Iterator itr = affectedEntityNames.iterator();
    6
    while (itr.hasNext())
    3
    while (itr.hasNext())
                                                                                                
    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
    4
    final String entityName = (String)itr.next();
    7
    final File file = (File)itr.next();
    7
    final File file = (File)itr.next();
    Preondition Violations
    Unmatched statement final File file=(File)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                            
    8
    collectClassNames(file, classNames);
    8
    collectClassNames(file, classNames);
    5
    session.getFactory().evictEntity(entityName);
    Differences
    Expression1Expression2Difference
    collectClassNamesevictEntityMETHOD_INVOCATION_NAME_MISMATCH
    collectClassNames(file,classNames)session.getFactory().evictEntity(entityName)ARGUMENT_NUMBER_MISMATCH
    session.getFactory()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized
    Expression session.getFactory().evictEntity(entityName) is a void method call, and thus it cannot be parameterized
    Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized
    Expression session.getFactory().evictEntity(entityName) is a void method call, and thus it cannot be parameterized
    5
    session.getFactory().evictEntity(entityName);
    Precondition Violations (6)
    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 File file=(File)itr.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized
    4Expression session.getFactory().evictEntity(entityName) is a void method call, and thus it cannot be parameterized
    5Expression collectClassNames(file,classNames) is a void method call, and thus it cannot be parameterized
    6Expression session.getFactory().evictEntity(entityName) is a void method call, and thus it cannot be parameterized