if ( listeners == null ) { eventListeners.setPostCommitUpdateEventListeners( new PostUpdateEventListener[]{} ); } else { eventListeners.setPostCommitUpdateEventListeners( (PostUpdateEventListener[]) listeners ); }
if ( listeners == null ) { eventListeners.setPreCollectionUpdateEventListeners( new PreCollectionUpdateEventListener[]{} ); } else { eventListeners.setPreCollectionUpdateEventListeners( ( PreCollectionUpdateEventListener[]) 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.setPostCommitUpdateEventListeners(
2
				eventListeners.setPreCollectionUpdateEventListeners(
3
						new PostUpdateEventListener[]{}
3
 new PreCollectionUpdateEventListener[]{}
4
					);
4
 );
5
			}
5
			}
6
			else {
6
			else {
7
				eventListeners.setPostCommitUpdateEventListeners( (PostUpdateEventListener[]) listeners );
7
				eventListeners.setPreCollectionUpdateEventListeners( ( PreCollectionUpdateEventListener[]) listeners );
8
			}
8
			}
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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    114
    if (listeners == null)
    94
    if (listeners == null)
    115
    eventListeners.setPostCommitUpdateEventListeners(new PostUpdateEventListener[] {});
    115
    eventListeners.setPostCommitUpdateEventListeners(new PostUpdateEventListener[] {});
    95
    eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[] {});
    Differences
    Expression1Expression2Difference
    setPostCommitUpdateEventListenerssetPreCollectionUpdateEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PostUpdateEventListenerorg.hibernate.event.PreCollectionUpdateEventListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eventListeners.setPostCommitUpdateEventListeners(new PostUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    Expression eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    Type org.hibernate.event.PostUpdateEventListener of variable PostUpdateEventListener does not match with type org.hibernate.event.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener
    • Make classes org.hibernate.event.PostUpdateEventListener and org.hibernate.event.PreCollectionUpdateEventListener extend a common superclass
    95
    eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[] {});
    else
    else
    116
    eventListeners.setPostCommitUpdateEventListeners((PostUpdateEventListener[])listeners);
    116
    eventListeners.setPostCommitUpdateEventListeners((PostUpdateEventListener[])listeners);
    96
    eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners);
    Differences
    Expression1Expression2Difference
    setPostCommitUpdateEventListenerssetPreCollectionUpdateEventListenersMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.event.PostUpdateEventListenerorg.hibernate.event.PreCollectionUpdateEventListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression eventListeners.setPostCommitUpdateEventListeners((PostUpdateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression eventListeners.setPostCommitUpdateEventListeners((PostUpdateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    Expression eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    Type org.hibernate.event.PostUpdateEventListener of variable PostUpdateEventListener does not match with type org.hibernate.event.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener
    • Make classes org.hibernate.event.PostUpdateEventListener and org.hibernate.event.PreCollectionUpdateEventListener extend a common superclass
    96
    eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners);
    Precondition Violations (8)
    Row Violation
    1Expression eventListeners.setPostCommitUpdateEventListeners(new PostUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    2Expression eventListeners.setPreCollectionUpdateEventListeners(new PreCollectionUpdateEventListener[]{}) is a void method call, and thus it cannot be parameterized
    3Type org.hibernate.event.PostUpdateEventListener of variable PostUpdateEventListener does not match with type org.hibernate.event.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener
    4Expression eventListeners.setPostCommitUpdateEventListeners((PostUpdateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression eventListeners.setPostCommitUpdateEventListeners((PostUpdateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    7Expression eventListeners.setPreCollectionUpdateEventListeners((PreCollectionUpdateEventListener[])listeners) is a void method call, and thus it cannot be parameterized
    8Type org.hibernate.event.PostUpdateEventListener of variable PostUpdateEventListener does not match with type org.hibernate.event.PreCollectionUpdateEventListener of variable PreCollectionUpdateEventListener