if (elementIsPureFormula) { throw new AssertionFailure("cannot use a formula-based element in the where condition"); } getElementType().nullSafeSet(st, elt, i, elementColumnIsInPrimaryKey, session); return i + elementColumnAliases.length;
if (indexContainsFormula) { throw new AssertionFailure("cannot use a formula-based index in the where condition"); } getIndexType().nullSafeSet( st, incrementIndexByBase(index), i, session ); return i + indexColumnAliases.length;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
Method name: int writeElementToWhere(PreparedStatement, Object, int, SessionImplementor) Method name: int writeIndexToWhere(PreparedStatement, Object, int, SessionImplementor)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (elementIsPureFormula) {
1
if (indexContainsFormula) {
2
			throw new AssertionFailure("cannot use a formula-based element in the where condition");
2
			throw new AssertionFailure("cannot use a formula-based index in the where condition");
3
		}
3
		}
4
		getElementType().nullSafeSet(st, elt, i, elementColumnIsInPrimaryKey, session);
4
		getIndexType().nullSafeSet( st, incrementIndexByBase(index), i, session );
5
		return i + elementColumnAliases.length;
5
		return i + indexColumnAliases.length;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {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)4.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (elementIsPureFormula)
    1
    if (elementIsPureFormula)
    1
    if (indexContainsFormula)
    Differences
    Expression1Expression2Difference
    elementIsPureFormulaindexContainsFormulaVARIABLE_NAME_MISMATCH
    1
    if (indexContainsFormula)
    2
    throw new AssertionFailure("cannot use a formula-based element in the where condition");
    2
    throw new AssertionFailure("cannot use a formula-based element in the where condition");
    2
    throw new AssertionFailure("cannot use a formula-based index in the where condition");
    Differences
    Expression1Expression2Difference
    "cannot use a formula-based element in the where condition""cannot use a formula-based index in the where condition"LITERAL_VALUE_MISMATCH
    2
    throw new AssertionFailure("cannot use a formula-based index in the where condition");
    3
    getElementType().nullSafeSet(st, elt, i, elementColumnIsInPrimaryKey, session);
    3
    getElementType().nullSafeSet(st, elt, i, elementColumnIsInPrimaryKey, session);
    3
    getIndexType().nullSafeSet(st, incrementIndexByBase(index), i, session);
    Differences
    Expression1Expression2Difference
    getElementTypegetIndexTypeMETHOD_INVOCATION_NAME_MISMATCH
    getElementType().nullSafeSet(st,elt,i,elementColumnIsInPrimaryKey,session)getIndexType().nullSafeSet(st,incrementIndexByBase(index),i,session)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression getElementType().nullSafeSet(st,elt,i,elementColumnIsInPrimaryKey,session) is a void method call, and thus it cannot be parameterized
    Expression getIndexType().nullSafeSet(st,incrementIndexByBase(index),i,session) is a void method call, and thus it cannot be parameterized
    3
    getIndexType().nullSafeSet(st, incrementIndexByBase(index), i, session);
    4
    return i + elementColumnAliases.length;
    4
    return i + elementColumnAliases.length;
    4
    return i + indexColumnAliases.length;
    Differences
    Expression1Expression2Difference
    elementColumnAliasesindexColumnAliasesVARIABLE_NAME_MISMATCH
    4
    return i + indexColumnAliases.length;
    Precondition Violations (2)
    Row Violation
    1Expression getElementType().nullSafeSet(st,elt,i,elementColumnIsInPrimaryKey,session) is a void method call, and thus it cannot be parameterized
    2Expression getIndexType().nullSafeSet(st,incrementIndexByBase(index),i,session) is a void method call, and thus it cannot be parameterized