if ( listeners == null ) { eventListeners.setPostCollectionUpdateEventListeners( new PostCollectionUpdateEventListener[]{} ); } else { eventListeners.setPostCollectionUpdateEventListeners( ( PostCollectionUpdateEventListener[]) listeners ); }
if ( listeners == null ) { eventListeners.setPostCollectionRecreateEventListeners( new PostCollectionRecreateEventListener[]{} ); } else { eventListeners.setPostCollectionRecreateEventListeners( (PostCollectionRecreateEventListener[]) listeners ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java
Method name: void setListeners(String, Object[]) Method name: void setListeners(String, Object[])
Number of AST nodes: 3 Number of AST nodes: 3
1
if ( listeners == null ) {
1
if ( listeners == null ) {
2
				eventListeners.setPostCollectionUpdateEventListeners( new PostCollectionUpdateEventListener[]{} );
2
				eventListeners.setPostCollectionRecreateEventListeners( new PostCollectionRecreateEventListener[]{} );
3
			}
3
			}
4
			else {
4
			else {
5
				eventListeners.setPostCollectionUpdateEventListeners( ( PostCollectionUpdateEventListener[]) listeners );
5
				eventListeners.setPostCollectionRecreateEventListeners( (PostCollectionRecreateEventListener[]) listeners );
6
			}
6
			}
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.3
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)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    134
    if (listeners == null)
    126
    if (listeners == null)
    135
    eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[] {});
    135
    eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[] {});
    127
    eventListeners.setPostCollectionRecreateEventListeners(new PostCollectionRecreateEventListener[] {});
    Differences
    Expression1Expression2Difference
    setPostCollectionUpdateEventListenerssetPostCollectionRecreateEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PostCollectionUpdateEventListenerorg.hibernate.event.PostCollectionRecreateEventListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    Expression eventListeners.setPostCollectionRecreateEventListeners(new PostCollectionRecreateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    Type org.hibernate.event.PostCollectionUpdateEventListener of variable PostCollectionUpdateEventListener does not match with type org.hibernate.event.PostCollectionRecreateEventListener of variable PostCollectionRecreateEventListener
    • Make classes org.hibernate.event.PostCollectionUpdateEventListener and org.hibernate.event.PostCollectionRecreateEventListener extend a common superclass
    127
    eventListeners.setPostCollectionRecreateEventListeners(new PostCollectionRecreateEventListener[] {});
    else
    else
    136
    eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners);
    136
    eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners);
    128
    eventListeners.setPostCollectionRecreateEventListeners((PostCollectionRecreateEventListener[])listeners);
    Differences
    Expression1Expression2Difference
    setPostCollectionUpdateEventListenerssetPostCollectionRecreateEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PostCollectionUpdateEventListenerorg.hibernate.event.PostCollectionRecreateEventListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eventListeners.setPostCollectionRecreateEventListeners((PostCollectionRecreateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    Expression eventListeners.setPostCollectionRecreateEventListeners((PostCollectionRecreateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    Type org.hibernate.event.PostCollectionUpdateEventListener of variable PostCollectionUpdateEventListener does not match with type org.hibernate.event.PostCollectionRecreateEventListener of variable PostCollectionRecreateEventListener
    • Make classes org.hibernate.event.PostCollectionUpdateEventListener and org.hibernate.event.PostCollectionRecreateEventListener extend a common superclass
    128
    eventListeners.setPostCollectionRecreateEventListeners((PostCollectionRecreateEventListener[])listeners);
    Precondition Violations (8)
    Row Violation
    1Expression eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    2Expression eventListeners.setPostCollectionRecreateEventListeners(new PostCollectionRecreateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    3Type org.hibernate.event.PostCollectionUpdateEventListener of variable PostCollectionUpdateEventListener does not match with type org.hibernate.event.PostCollectionRecreateEventListener of variable PostCollectionRecreateEventListener
    4Expression eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression eventListeners.setPostCollectionRecreateEventListeners((PostCollectionRecreateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    7Expression eventListeners.setPostCollectionRecreateEventListeners((PostCollectionRecreateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    8Type org.hibernate.event.PostCollectionUpdateEventListener of variable PostCollectionUpdateEventListener does not match with type org.hibernate.event.PostCollectionRecreateEventListener of variable PostCollectionRecreateEventListener