PostCollectionRecreateEvent postEvent = new PostCollectionRecreateEvent( getPersister(), getCollection(), ( EventSource ) getSession() ); for ( int i = 0; i < postListeners.length; i++ ) { postListeners[i].onPostRecreateCollection( postEvent ); }
PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent( getPersister(), getCollection(), ( EventSource ) getSession() ); for ( int i = 0; i < postListeners.length; i++ ) { postListeners[i].onPostUpdateCollection( postEvent ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/CollectionRecreateAction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/CollectionUpdateAction.java
Method name: void postRecreate() Method name: void postUpdate()
Number of AST nodes: 3 Number of AST nodes: 3
1
PostCollectionRecreateEvent postEvent = new PostCollectionRecreateEvent(
1
PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(
2
					getPersister(), getCollection(), ( EventSource ) getSession() );
2
					getPersister(), getCollection(), ( EventSource ) getSession() );
3
			for ( int i = 0; i < postListeners.length; i++ ) {
3
			for ( int i = 0; i < postListeners.length; i++ ) {
4
				postListeners[i].onPostRecreateCollection( postEvent );
4
				postListeners[i].onPostUpdateCollection( postEvent );
5
			}
5
			}
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 different classes having the same super class
Number of node comparisons6
  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)24.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    PostCollectionRecreateEvent postEvent = new PostCollectionRecreateEvent(getPersister(), getCollection(), (EventSource)getSession());
    3
    PostCollectionRecreateEvent postEvent = new PostCollectionRecreateEvent(getPersister(), getCollection(), (EventSource)getSession());
    3
    PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(getPersister(), getCollection(), (EventSource)getSession());
    Differences
    Expression1Expression2Difference
    org.hibernate.event.PostCollectionRecreateEventorg.hibernate.event.PostCollectionUpdateEventSUBCLASS_TYPE_MISMATCH
    org.hibernate.event.PostCollectionRecreateEventorg.hibernate.event.PostCollectionUpdateEventSUBCLASS_TYPE_MISMATCH
    org.hibernate.event.PostCollectionRecreateEventorg.hibernate.event.PostCollectionUpdateEventSUBCLASS_TYPE_MISMATCH
    3
    PostCollectionUpdateEvent postEvent = new PostCollectionUpdateEvent(getPersister(), getCollection(), (EventSource)getSession());
    4
    for (int i = 0; i < postListeners.length; i++)
    4
    for (int i = 0; i < postListeners.length; i++)
    4
    for (int i = 0; i < postListeners.length; i++)
    Differences
    Expression1Expression2Difference
    org.hibernate.event.PostCollectionRecreateEventListener[]org.hibernate.event.PostCollectionUpdateEventListener[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable postListeners.length does not match with type int of variable postListeners.length
    • Make classes org.hibernate.event.PostCollectionRecreateEventListener[] and org.hibernate.event.PostCollectionUpdateEventListener[] extend a common superclass
    4
    for (int i = 0; i < postListeners.length; i++)
    5
    postListeners[i].onPostRecreateCollection(postEvent);
    5
    postListeners[i].onPostRecreateCollection(postEvent);
    5
    postListeners[i].onPostUpdateCollection(postEvent);
    Differences
    Expression1Expression2Difference
    org.hibernate.event.PostCollectionRecreateEventorg.hibernate.event.PostCollectionUpdateEventSUBCLASS_TYPE_MISMATCH
    onPostRecreateCollectiononPostUpdateCollectionMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PostCollectionRecreateEventListener[]org.hibernate.event.PostCollectionUpdateEventListener[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression postListeners[i].onPostRecreateCollection(postEvent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression postListeners[i].onPostUpdateCollection(postEvent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression postListeners[i].onPostRecreateCollection(postEvent) is a void method call, and thus it cannot be parameterized
    Expression postListeners[i].onPostUpdateCollection(postEvent) is a void method call, and thus it cannot be parameterized
    Type org.hibernate.event.PostCollectionRecreateEventListener[] of variable postListeners does not match with type org.hibernate.event.PostCollectionUpdateEventListener[] of variable postListeners
    • Make classes org.hibernate.event.PostCollectionRecreateEventListener[] and org.hibernate.event.PostCollectionUpdateEventListener[] extend a common superclass
    5
    postListeners[i].onPostUpdateCollection(postEvent);
    Precondition Violations (6)
    Row Violation
    1Type int of variable postListeners.length does not match with type int of variable postListeners.length
    2Expression postListeners[i].onPostRecreateCollection(postEvent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression postListeners[i].onPostUpdateCollection(postEvent) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression postListeners[i].onPostRecreateCollection(postEvent) is a void method call, and thus it cannot be parameterized
    5Expression postListeners[i].onPostUpdateCollection(postEvent) is a void method call, and thus it cannot be parameterized
    6Type org.hibernate.event.PostCollectionRecreateEventListener[] of variable postListeners does not match with type org.hibernate.event.PostCollectionUpdateEventListener[] of variable postListeners