if ( entity instanceof Document ) { currentState[2] = Calendar.getInstance(); return true; } else { return false; }
if ( entity instanceof Document ) { currentState[3] = Calendar.getInstance(); return true; } else { return false; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/interfaceproxy/DocumentInterceptor.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/mixed/DocumentInterceptor.java
Method name: boolean onFlushDirty(Object, Serializable, Object[], Object[], String[], Type[]) Method name: boolean onFlushDirty(Object, Serializable, Object[], Object[], String[], Type[])
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( entity instanceof Document ) {
1
if ( entity instanceof Document ) {
2
			currentState[2] = Calendar.getInstance();
2
			currentState[3] = Calendar.getInstance();
3
			return true;
3
			return true;
4
		}
4
		}
5
		else {
5
		else {
6
			return false;
6
			return false;
7
		}
7
		}
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.1
Clones locationClones are in different classes
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (entity instanceof Document)
    1
    if (entity instanceof Document)
    1
    if (entity instanceof Document)
    Differences
    Expression1Expression2Difference
    org.hibernate.test.interfaceproxy.Documentorg.hibernate.test.mixed.DocumentVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.interfaceproxy.Document does not match with type org.hibernate.test.mixed.Document
    • Make classes org.hibernate.test.interfaceproxy.Document and org.hibernate.test.mixed.Document extend a common superclass
    1
    if (entity instanceof Document)
    2
    currentState[2] = Calendar.getInstance();
    2
    currentState[2] = Calendar.getInstance();
    2
    currentState[3] = Calendar.getInstance();
    Differences
    Expression1Expression2Difference
    23LITERAL_VALUE_MISMATCH
    2
    currentState[3] = Calendar.getInstance();
    3
    return true;
    3
    return true;
    else
    else
    4
    return false;
    4
    return false;
    Precondition Violations (1)
    Row Violation
    1Type org.hibernate.test.interfaceproxy.Document does not match with type org.hibernate.test.mixed.Document