if ( affectedEntityNames != null ) { Iterator itr = affectedEntityNames.iterator(); while ( itr.hasNext() ) { final String entityName = ( String ) itr.next(); session.getFactory().evictEntity( entityName ); } }
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/action/BulkOperationCleanupAction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/BulkOperationCleanupAction.java
Method name: void evictEntityRegions() Method name: void evictCollectionRegions()
Number of AST nodes: 5 Number of AST nodes: 5
1
if ( affectedEntityNames != null ) {
1
if ( affectedCollectionRoles != null ) {
2
			Iterator itr = affectedEntityNames.iterator();
2
			Iterator itr = affectedCollectionRoles.iterator();
3
			while ( itr.hasNext() ) {
3
			while ( itr.hasNext() ) {
4
				final String entityName = ( String ) itr.next();
4
				final String roleName = ( String ) itr.next();
5
				session.getFactory().evictEntity( entityName );
5
				session.getFactory().evictCollection( roleName );
6
			}
6
			}
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 declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (affectedEntityNames != null)
    1
    if (affectedEntityNames != null)
    1
    if (affectedCollectionRoles != null)
    Differences
    Expression1Expression2Difference
    affectedEntityNamesaffectedCollectionRolesVARIABLE_NAME_MISMATCH
    1
    if (affectedCollectionRoles != null)
    2
    Iterator itr = affectedEntityNames.iterator();
    2
    Iterator itr = affectedEntityNames.iterator();
    2
    Iterator itr = affectedCollectionRoles.iterator();
    Differences
    Expression1Expression2Difference
    affectedEntityNamesaffectedCollectionRolesVARIABLE_NAME_MISMATCH
    2
    Iterator itr = affectedCollectionRoles.iterator();
    3
    while (itr.hasNext())
    3
    while (itr.hasNext())
    4
    final String entityName = (String)itr.next();
    4
    final String entityName = (String)itr.next();
    4
    final String roleName = (String)itr.next();
    Differences
    Expression1Expression2Difference
    entityNameroleNameVARIABLE_NAME_MISMATCH
    4
    final String roleName = (String)itr.next();
    5
    session.getFactory().evictEntity(entityName);
    5
    session.getFactory().evictEntity(entityName);
    5
    session.getFactory().evictCollection(roleName);
    Differences
    Expression1Expression2Difference
    evictEntityevictCollectionMETHOD_INVOCATION_NAME_MISMATCH
    entityNameroleNameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression session.getFactory().evictEntity(entityName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression session.getFactory().evictCollection(roleName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression session.getFactory().evictEntity(entityName) 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 (4)
    Row Violation
    1Expression session.getFactory().evictEntity(entityName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression session.getFactory().evictCollection(roleName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression session.getFactory().evictEntity(entityName) 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