if ( ce.isDoremove() ) { session.getInterceptor().onCollectionRemove( coll, ce.getLoadedKey() ); actionQueue.addAction( new CollectionRemoveAction( coll, ce.getLoadedPersister(), ce.getLoadedKey(), ce.isSnapshotEmpty(coll), session ) ); }
if ( ce.isDoupdate() ) { session.getInterceptor().onCollectionUpdate( coll, ce.getLoadedKey() ); actionQueue.addAction( new CollectionUpdateAction( coll, ce.getLoadedPersister(), ce.getLoadedKey(), ce.isSnapshotEmpty(coll), session ) ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/AbstractFlushingEventListener.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/AbstractFlushingEventListener.java
Method name: void flushCollections(EventSource) Method name: void flushCollections(EventSource)
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( ce.isDoremove() ) {
1
if ( ce.isDoupdate() ) {
2
				session.getInterceptor().onCollectionRemove( coll, ce.getLoadedKey() );
2
				session.getInterceptor().onCollectionUpdate( coll, ce.getLoadedKey() );
3
				actionQueue.addAction(
3
				actionQueue.addAction(
4
						new CollectionRemoveAction( 
4
						new CollectionUpdateAction( 
5
								coll, 
5
								coll, 
6
								ce.getLoadedPersister(), 
6
								ce.getLoadedPersister(), 
7
								ce.getLoadedKey(), 
7
								ce.getLoadedKey(), 
8
								ce.isSnapshotEmpty(coll), 
8
								ce.isSnapshotEmpty(coll), 
9
								session 
9
								session 
10
							)
10
							)
11
					);
11
					);
12
			}
12
			}
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.2
Clones locationClones are in the same method
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    20
    if (ce.isDoremove())
    20
    if (ce.isDoremove())
    23
    if (ce.isDoupdate())
    Differences
    Expression1Expression2Difference
    isDoremoveisDoupdateMETHOD_INVOCATION_NAME_MISMATCH
    23
    if (ce.isDoupdate())
    21
    session.getInterceptor().onCollectionRemove(coll, ce.getLoadedKey());
    21
    session.getInterceptor().onCollectionRemove(coll, ce.getLoadedKey());
    24
    session.getInterceptor().onCollectionUpdate(coll, ce.getLoadedKey());
    Differences
    Expression1Expression2Difference
    onCollectionRemoveonCollectionUpdateMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression session.getInterceptor().onCollectionRemove(coll,ce.getLoadedKey()) is a void method call, and thus it cannot be parameterized
    Expression session.getInterceptor().onCollectionUpdate(coll,ce.getLoadedKey()) is a void method call, and thus it cannot be parameterized
    24
    session.getInterceptor().onCollectionUpdate(coll, ce.getLoadedKey());
    22
    actionQueue.addAction(new CollectionRemoveAction(coll, ce.getLoadedPersister(), ce.getLoadedKey(), ce.isSnapshotEmpty(coll), session));
    22
    actionQueue.addAction(new CollectionRemoveAction(coll, ce.getLoadedPersister(), ce.getLoadedKey(), ce.isSnapshotEmpty(coll), session));
    25
    actionQueue.addAction(new CollectionUpdateAction(coll, ce.getLoadedPersister(), ce.getLoadedKey(), ce.isSnapshotEmpty(coll), session));
    Differences
    Expression1Expression2Difference
    org.hibernate.action.CollectionRemoveActionorg.hibernate.action.CollectionUpdateActionSUBCLASS_TYPE_MISMATCH
    25
    actionQueue.addAction(new CollectionUpdateAction(coll, ce.getLoadedPersister(), ce.getLoadedKey(), ce.isSnapshotEmpty(coll), session));
    Precondition Violations (2)
    Row Violation
    1Expression session.getInterceptor().onCollectionRemove(coll,ce.getLoadedKey()) is a void method call, and thus it cannot be parameterized
    2Expression session.getInterceptor().onCollectionUpdate(coll,ce.getLoadedKey()) is a void method call, and thus it cannot be parameterized