if ( !isOperationQueueEnabled() ) { write(); return list.add(object); } else { queueOperation( new SimpleAdd(object) ); return true; }
if ( !isOperationQueueEnabled() ) { write(); return bag.add(object); } else { queueOperation( new SimpleAdd(object) ); return true; }
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/PersistentBag.java
Method name: boolean add(Object) Method name: boolean add(Object)
Number of AST nodes: 5 Number of AST nodes: 5
1
if ( !isOperationQueueEnabled() ) {
1
if ( !isOperationQueueEnabled() ) {
2
			write();
2
			write();
3
			return list.add(object);
3
			return bag.add(object);
4
		}
4
		}
5
		else {
5
		else {
6
			queueOperation( new SimpleAdd(object) );
6
			queueOperation( new SimpleAdd(object) );
7
			return true;
7
			return true;
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!isOperationQueueEnabled())
    1
    if (!isOperationQueueEnabled())
    2
    write();
    2
    write();
    3
    return list.add(object);
    3
    return list.add(object);
    3
    return bag.add(object);
    Differences
    Expression1Expression2Difference
    listbagVARIABLE_NAME_MISMATCH
    3
    return bag.add(object);
    else
    else
    4
    queueOperation(new SimpleAdd(object));
    4
    queueOperation(new SimpleAdd(object));
    4
    queueOperation(new SimpleAdd(object));
    Differences
    Expression1Expression2Difference
    org.hibernate.collection.PersistentList.SimpleAddorg.hibernate.collection.PersistentBag.SimpleAddVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.collection.PersistentList.SimpleAdd of variable new SimpleAdd(object) does not match with type org.hibernate.collection.PersistentBag.SimpleAdd of variable new SimpleAdd(object)
    • Make classes org.hibernate.collection.PersistentList.SimpleAdd and org.hibernate.collection.PersistentBag.SimpleAdd extend a common superclass
    4
    queueOperation(new SimpleAdd(object));
    5
    return true;
    5
    return true;
    Precondition Violations (1)
    Row Violation
    1Type org.hibernate.collection.PersistentList.SimpleAdd of variable new SimpleAdd(object) does not match with type org.hibernate.collection.PersistentBag.SimpleAdd of variable new SimpleAdd(object)