while ( referencedColumnsIterator.hasNext() ) { Selectable col = (Selectable) referencedColumnsIterator.next(); if ( !col.isFormula() ) addReferencedColumn( (Column) col ); }
while ( columnIterator.hasNext() ) { Selectable col = (Selectable) columnIterator.next(); if ( !col.isFormula() ) addColumn( (Column) col ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/ForeignKey.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/mapping/Constraint.java
Method name: void addReferencedColumns(Iterator) Method name: void addColumns(Iterator)
Number of AST nodes: 4 Number of AST nodes: 4
1
while ( referencedColumnsIterator.hasNext() ) {
1
while ( columnIterator.hasNext() ) {
2
			Selectable col = (Selectable) referencedColumnsIterator.next();
2
			Selectable col = (Selectable) columnIterator.next();
3
			if ( !col.isFormula() ) addReferencedColumn( (Column) col );
3
			if ( !col.isFormula() ) addColumn( (Column) col );
4
		}
4
		}
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 comparisons8
  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)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    while (referencedColumnsIterator.hasNext())
    1
    while (referencedColumnsIterator.hasNext())
    1
    while (columnIterator.hasNext())
    Differences
    Expression1Expression2Difference
    referencedColumnsIteratorcolumnIteratorVARIABLE_NAME_MISMATCH
    1
    while (columnIterator.hasNext())
    2
    Selectable col = (Selectable)referencedColumnsIterator.next();
    2
    Selectable col = (Selectable)referencedColumnsIterator.next();
    2
    Selectable col = (Selectable)columnIterator.next();
    Differences
    Expression1Expression2Difference
    referencedColumnsIteratorcolumnIteratorVARIABLE_NAME_MISMATCH
    2
    Selectable col = (Selectable)columnIterator.next();
    3
    if (!col.isFormula())
    3
    if (!col.isFormula())
    4
    addReferencedColumn((Column)col);
    4
    addReferencedColumn((Column)col);
    4
    addColumn((Column)col);
    Differences
    Expression1Expression2Difference
    addReferencedColumnaddColumnMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression addReferencedColumn((Column)col) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method addReferencedColumn
    Expression addColumn((Column)col) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addReferencedColumn((Column)col) is a void method call, and thus it cannot be parameterized
    Expression addColumn((Column)col) is a void method call, and thus it cannot be parameterized
    4
    addColumn((Column)col);
    Precondition Violations (4)
    Row Violation
    1Expression addReferencedColumn((Column)col) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression addColumn((Column)col) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression addReferencedColumn((Column)col) is a void method call, and thus it cannot be parameterized
    4Expression addColumn((Column)col) is a void method call, and thus it cannot be parameterized