if ( exists == null ) { initialize( true ); if ( list.remove( value ) ) { dirty(); return true; } else { return false; } } else if ( exists.booleanValue() ) { queueOperation( new SimpleRemove(value) ); return true; } else { return false; }
if ( exists==null ) { initialize( true ); if ( set.remove( value ) ) { dirty(); return true; } else { return false; } } else if ( exists.booleanValue() ) { queueOperation( new SimpleRemove(value) ); return true; } else { return false; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentList.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentSet.java
Method name: boolean remove(Object) Method name: boolean remove(Object)
Number of AST nodes: 10 Number of AST nodes: 10
1
if ( exists == null ) {
1
if ( exists==null ) {
2
			initialize( true );
2
			initialize( true );
3
			if ( list.remove( value ) ) {
3
			if ( set.remove( value ) ) {
4
				dirty();
4
				dirty();
5
				return true;
5
				return true;
6
			}
6
			}
7
			else {
7
			else {
8
				return false;
8
				return false;
9
			}
9
			}
10
		}
10
		}
11
		else if ( exists.booleanValue() ) {
11
		else if ( exists.booleanValue() ) {
12
			queueOperation( new SimpleRemove(value) );
12
			queueOperation( new SimpleRemove(value) );
13
			return true;
13
			return true;
14
		}
14
		}
15
		else {
15
		else {
16
			return false;
16
			return false;
17
		}
17
		}
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)19.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (exists == null)
    2
    if (exists == null)
    3
    initialize(true);
    3
    initialize(true);
    4
    if (list.remove(value))
    4
    if (list.remove(value))
    4
    if (set.remove(value))
    Differences
    Expression1Expression2Difference
    listsetVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.SetSUBCLASS_TYPE_MISMATCH
    4
    if (set.remove(value))
    5
    dirty();
    5
    dirty();
    6
    return true;
    6
    return true;
    else
    else
    7
    return false;
    7
    return false;
    8
    else if (exists.booleanValue())
    8
    else if (exists.booleanValue())
    9
    queueOperation(new SimpleRemove(value));
    9
    queueOperation(new SimpleRemove(value));
    9
    queueOperation(new SimpleRemove(value));
    Differences
    Expression1Expression2Difference
    org.hibernate.collection.PersistentList.SimpleRemoveorg.hibernate.collection.PersistentSet.SimpleRemoveSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new SimpleRemove(value) cannot be unified with expression new SimpleRemove(value) , because common superclass type org.hibernate.collection.AbstractPersistentCollection.DelayedOperation cannot be passed as an argument to protected final void queueOperation(java.lang.Object)
    9
    queueOperation(new SimpleRemove(value));
    10
    return true;
    10
    return true;
    else
    else
    11
    return false;
    11
    return false;
    Precondition Violations (1)
    Row Violation
    1Expression new SimpleRemove(value) cannot be unified with expression new SimpleRemove(value) , because common superclass type org.hibernate.collection.AbstractPersistentCollection.DelayedOperation cannot be passed as an argument to protected final void queueOperation(java.lang.Object)