if ( !isOperationQueueEnabled() ) { write(); return bag.addAll(values); } else { Iterator iter = values.iterator(); while ( iter.hasNext() ) { queueOperation( new SimpleAdd( iter.next() ) ); } return values.size()>0; }
if ( !isOperationQueueEnabled() ) { write(); return list.addAll(values); } else { Iterator iter = values.iterator(); while ( iter.hasNext() ) { queueOperation( new SimpleAdd( iter.next() ) ); } return values.size()>0; }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentBag.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentList.java
Method name: boolean addAll(Collection) Method name: boolean addAll(Collection)
Number of AST nodes: 7 Number of AST nodes: 7
1
if ( !isOperationQueueEnabled() ) {
1
if ( !isOperationQueueEnabled() ) {
2
			write();
2
			write();
3
			return bag.addAll(values);
3
			return list.addAll(values);
4
		}
4
		}
5
		else {
5
		else {
6
			Iterator iter = values.iterator();
6
			Iterator iter = values.iterator();
7
			while ( iter.hasNext() ) {
7
			while ( iter.hasNext() ) {
8
				queueOperation( new SimpleAdd( iter.next() ) );
8
				queueOperation( new SimpleAdd( iter.next() ) );
9
			}
9
			}
10
			return values.size()>0;
10
			return values.size()>0;
11
		}
11
		}
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 different classes having the same super class
Number of node comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)20.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (!isOperationQueueEnabled())
    3
    if (!isOperationQueueEnabled())
    4
    write();
    4
    write();
    5
    return bag.addAll(values);
    5
    return bag.addAll(values);
    5
    return list.addAll(values);
    Differences
    Expression1Expression2Difference
    baglistVARIABLE_NAME_MISMATCH
    5
    return list.addAll(values);
    else
    else
    6
    Iterator iter = values.iterator();
    6
    Iterator iter = values.iterator();
    7
    while (iter.hasNext())
    7
    while (iter.hasNext())
    8
    queueOperation(new SimpleAdd(iter.next()));
    8
    queueOperation(new SimpleAdd(iter.next()));
    8
    queueOperation(new SimpleAdd(iter.next()));
    Differences
    Expression1Expression2Difference
    org.hibernate.collection.PersistentBag.SimpleAddorg.hibernate.collection.PersistentList.SimpleAddSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new SimpleAdd(iter.next()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new SimpleAdd(iter.next()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new SimpleAdd(iter.next()) cannot be unified with expression new SimpleAdd(iter.next()) , because common superclass type org.hibernate.collection.AbstractPersistentCollection.DelayedOperation cannot be passed as an argument to protected final void queueOperation(java.lang.Object)
    8
    queueOperation(new SimpleAdd(iter.next()));
    9
    return values.size() > 0;
    9
    return values.size() > 0;
    Precondition Violations (4)
    Row Violation
    1Expression new SimpleAdd(iter.next()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new SimpleAdd(iter.next()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new SimpleAdd(iter.next()) cannot be unified with expression new SimpleAdd(iter.next()) , because common superclass type org.hibernate.collection.AbstractPersistentCollection.DelayedOperation cannot be passed as an argument to protected final void queueOperation(java.lang.Object)
    4Not all possible execution flows end in a return statement