if ( listeners == null ) { eventListeners.setPostCollectionUpdateEventListeners( new PostCollectionUpdateEventListener[]{} ); } else { eventListeners.setPostCollectionUpdateEventListeners( ( PostCollectionUpdateEventListener[]) listeners ); }
if ( listeners == null ) { eventListeners.setLockEventListeners( new LockEventListener[]{} ); } else { eventListeners.setLockEventListeners( (LockEventListener[]) 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.setLockEventListeners( new LockEventListener[]{} );
3
			}
3
			}
4
			else {
4
			else {
5
				eventListeners.setPostCollectionUpdateEventListeners( ( PostCollectionUpdateEventListener[]) listeners );
5
				eventListeners.setLockEventListeners( (LockEventListener[]) 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)
    46
    if (listeners == null)
    135
    eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[] {});
    135
    eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[] {});
    47
    eventListeners.setLockEventListeners(new LockEventListener[] {});
    Differences
    Expression1Expression2Difference
    setPostCollectionUpdateEventListenerssetLockEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PostCollectionUpdateEventListenerorg.hibernate.event.LockEventListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    Expression eventListeners.setLockEventListeners(new LockEventListener[]{}) 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.LockEventListener of variable LockEventListener
    • Make classes org.hibernate.event.PostCollectionUpdateEventListener and org.hibernate.event.LockEventListener extend a common superclass
    47
    eventListeners.setLockEventListeners(new LockEventListener[] {});
    else
    else
    136
    eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners);
    136
    eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners);
    48
    eventListeners.setLockEventListeners((LockEventListener[])listeners);
    Differences
    Expression1Expression2Difference
    setPostCollectionUpdateEventListenerssetLockEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PostCollectionUpdateEventListenerorg.hibernate.event.LockEventListenerVARIABLE_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.setLockEventListeners((LockEventListener[])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.setLockEventListeners((LockEventListener[])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.LockEventListener of variable LockEventListener
    • Make classes org.hibernate.event.PostCollectionUpdateEventListener and org.hibernate.event.LockEventListener extend a common superclass
    48
    eventListeners.setLockEventListeners((LockEventListener[])listeners);
    Precondition Violations (8)
    Row Violation
    1Expression eventListeners.setPostCollectionUpdateEventListeners(new PostCollectionUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    2Expression eventListeners.setLockEventListeners(new LockEventListener[]{}) 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.LockEventListener of variable LockEventListener
    4Expression eventListeners.setPostCollectionUpdateEventListeners((PostCollectionUpdateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression eventListeners.setLockEventListeners((LockEventListener[])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.setLockEventListeners((LockEventListener[])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.LockEventListener of variable LockEventListener