if ( key == null ) { throw new NullPointerException( "null key for collection: " + role ); //an assertion } getKeyType().nullSafeSet( st, key, i, session ); return i + keyColumnAliases.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 writeKey(PreparedStatement, Serializable, int, SessionImplementor) Method name: int writeIndexToWhere(PreparedStatement, Object, int, SessionImplementor)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( key == null ) {
1
if (
2
			throw new NullPointerException( "null key for collection: " + role );  //an asser
2
indexContainsFormula) {
3
tion
3
			throw new AssertionFailure("cannot use a formula-based index in the where condition");
4
		}
4
		}
5
		getKeyType().nullSafeSet( st, key, i, session );
5
		getIndexType().nullSafeSet( st, incrementIndexByBase(index), i, session );
6
		return i + keyColumnAliases.length;
6
		return i + indexColumnAliases.length;
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 declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                          
    1
    if (indexContainsFormula)
                                                                                                                                                                                      
    2
    throw new AssertionFailure("cannot use a formula-based index in the where condition");
    Preondition Violations
    Unmatched throw new AssertionFailure("cannot use a formula-based index in the where condition");
    2
    throw new AssertionFailure("cannot use a formula-based index in the where condition");
    1
    if (key == null)
                                        
    2
    throw new NullPointerException("null key for collection: " + role);
    2
    throw new NullPointerException("null key for collection: " + role);
    Preondition Violations
    Unmatched throw new NullPointerException("null key for collection: " + role);
                                                                                                                                                
                                                                                                                                                    
    3
    getIndexType().nullSafeSet(st, incrementIndexByBase(index), i, session);
    3
    getKeyType().nullSafeSet(st, key, i, session);
                                                                                                
    4
    return i + keyColumnAliases.length;
    4
    return i + keyColumnAliases.length;
    4
    return i + indexColumnAliases.length;
    Differences
    Expression1Expression2Difference
    keyColumnAliasesindexColumnAliasesVARIABLE_NAME_MISMATCH
    4
    return i + indexColumnAliases.length;
    Precondition Violations (2)
    Row Violation
    1Unmatched throw new AssertionFailure("cannot use a formula-based index in the where condition");
    2Unmatched throw new NullPointerException("null key for collection: " + role);