Iterator itr = files.iterator(); while ( itr.hasNext() ) { final File file = ( File ) itr.next(); processFile( file, classNames ); }
if ( affectedCollectionRoles != null ) { Iterator itr = affectedCollectionRoles.iterator(); while ( itr.hasNext() ) { final String roleName = ( String ) itr.next(); session.getFactory().evictCollection( roleName ); } }
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 evictCollectionRegions()
Number of AST nodes: 4 Number of AST nodes: 5
1
Iterator itr = fi
1
if ( affectedCollectionRoles != null ) {
2
les.iterator();
2
			Iterator itr = affectedCollectionRoles.iterator();
3
			while ( itr.hasNext() ) {
3
			while ( itr.hasNext() ) {
4
				final File file = ( File ) itr.next();
4
				final 
5
				processFile( file, class
5
String roleName = ( String ) itr.next();
6
Names );
6
				session.getFactory().evictCollection( roleName );
7
			}
7
			}
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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    Iterator itr = files.iterator();
    11
    Iterator itr = files.iterator();
    2
    Iterator itr = affectedCollectionRoles.iterator();
    Differences
    Expression1Expression2Difference
    filesaffectedCollectionRolesVARIABLE_NAME_MISMATCH
    2
    Iterator itr = affectedCollectionRoles.iterator();
    12
    while (itr.hasNext())
    3
    while (itr.hasNext())
                                                                                            
    4
    final String roleName = (String)itr.next();
    Preondition Violations
    Unmatched statement final String roleName=(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 roleName = (String)itr.next();
    13
    final File file = (File)itr.next();
    13
    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
                                                                              
    14
    processFile(file, classNames);
    14
    processFile(file, classNames);
    5
    session.getFactory().evictCollection(roleName);
    Differences
    Expression1Expression2Difference
    processFileevictCollectionMETHOD_INVOCATION_NAME_MISMATCH
    processFile(file,classNames)session.getFactory().evictCollection(roleName)ARGUMENT_NUMBER_MISMATCH
    session.getFactory()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression processFile(file,classNames) is a void method call, and thus it cannot be parameterized
    Expression session.getFactory().evictCollection(roleName) is a void method call, and thus it cannot be parameterized
    Expression processFile(file,classNames) is a void method call, and thus it cannot be parameterized
    Expression session.getFactory().evictCollection(roleName) is a void method call, and thus it cannot be parameterized
    5
    session.getFactory().evictCollection(roleName);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement final String roleName=(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 processFile(file,classNames) is a void method call, and thus it cannot be parameterized
    4Expression session.getFactory().evictCollection(roleName) is a void method call, and thus it cannot be parameterized
    5Expression processFile(file,classNames) is a void method call, and thus it cannot be parameterized
    6Expression session.getFactory().evictCollection(roleName) is a void method call, and thus it cannot be parameterized