if ( listeners == null ) { eventListeners.setPreCollectionUpdateEventListeners( new PreCollectionUpdateEventListener[]{} ); } else { eventListeners.setPreCollectionUpdateEventListeners( ( PreCollectionUpdateEventListener[]) 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.setPreCollectionUpdateEventListeners( new PreCollectionUpdateEventListener[]{} );
2
				eventListeners.setLockEventListeners( new LockEventListener[]{} );
3
			}
3
			}
4
			else {
4
			else {
5
				eventListeners.setPreCollectionUpdateEventListeners( ( PreCollectionUpdateEventListener[]) 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.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)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    94
    if (listeners == null)
    46
    if (listeners == null)
    95
    eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[] {});
    95
    eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[] {});
    47
    eventListeners.setLockEventListeners(new LockEventListener[] {});
    Differences
    Expression1Expression2Difference
    setPreCollectionUpdateEventListenerssetLockEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PreCollectionUpdateEventListenerorg.hibernate.event.LockEventListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[]{}) 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.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener does not match with type org.hibernate.event.LockEventListener of variable LockEventListener
    • Make classes org.hibernate.event.PreCollectionUpdateEventListener and org.hibernate.event.LockEventListener extend a common superclass
    47
    eventListeners.setLockEventListeners(new LockEventListener[] {});
    else
    else
    96
    eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners);
    96
    eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners);
    48
    eventListeners.setLockEventListeners((LockEventListener[])listeners);
    Differences
    Expression1Expression2Difference
    setPreCollectionUpdateEventListenerssetLockEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PreCollectionUpdateEventListenerorg.hibernate.event.LockEventListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])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.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])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.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener does not match with type org.hibernate.event.LockEventListener of variable LockEventListener
    • Make classes org.hibernate.event.PreCollectionUpdateEventListener and org.hibernate.event.LockEventListener extend a common superclass
    48
    eventListeners.setLockEventListeners((LockEventListener[])listeners);
    Precondition Violations (8)
    Row Violation
    1Expression eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[]{}) 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.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener does not match with type org.hibernate.event.LockEventListener of variable LockEventListener
    4Expression eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])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.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])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.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener does not match with type org.hibernate.event.LockEventListener of variable LockEventListener