Object id = getIdentifierType().nullSafeGet( rs, alias, session, null ); if ( id == null ) { throw new HibernateException( "null identifier column for collection: " + role ); } return id;
Class tuplizerClass = ( Class ) defaultImplClassByMode.get( entityMode ); if ( tuplizerClass == null ) { throw new HibernateException( "could not determine default tuplizer class to use [" + entityMode + "]" ); } return constructTuplizer( tuplizerClass, metamodel, persistentClass );
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/tuple/entity/EntityTuplizerFactory.java
Method name: Object readIdentifier(ResultSet, String, SessionImplementor) Method name: EntityTuplizer constructDefaultTuplizer(EntityMode, EntityMetamodel, PersistentClass)
Number of AST nodes: 4 Number of AST nodes: 4
1
Object id = getIdentifierType().nullSafeGet( rs, alias, session, null );
2
		if ( id
1
Class tuplizerClass = ( Class ) defaultImplClassByMode.get( entityMode );
3
 == null ) {
2
		if ( tuplizerClass == null ) {
4
			throw new HibernateException( "null identifier column for collection: " + role );
3
			throw new HibernateException( "could not determine default tuplizer class to use [" + entityMode + "]" );
5
		}
4
		}
6
		return id;
5
		return constructTuplizer( tuplizerClass, metamodel, persistentClass );
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
Number of node comparisons8
  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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                              
    1
    Class tuplizerClass = (Class)defaultImplClassByMode.get(entityMode);
    1
    Object id = getIdentifierType().nullSafeGet(rs, alias, session, null);
                                                                                                                                            
    2
    if (id == null)
    2
    if (id == null)
    2
    if (tuplizerClass == null)
    Differences
    Expression1Expression2Difference
    idtuplizerClassVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.lang.ClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable id does not match with type java.lang.Class of variable tuplizerClass
    • Make classes java.lang.Object and java.lang.Class extend a common superclass
    2
    if (tuplizerClass == null)
                                                                                                                                                                                                                        
    3
    throw new HibernateException("could not determine default tuplizer class to use [" + entityMode + "]");
    Preondition Violations
    Unmatched throw new HibernateException("could not determine default tuplizer class to use [" + entityMode + "]");
    3
    throw new HibernateException("could not determine default tuplizer class to use [" + entityMode + "]");
    3
    throw new HibernateException("null identifier column for collection: " + role);
    3
    throw new HibernateException("null identifier column for collection: " + role);
    Preondition Violations
    Unmatched throw new HibernateException("null identifier column for collection: " + role);
                                                                                                                                                                        
                                                                                                                                              
    4
    return constructTuplizer(tuplizerClass, metamodel, persistentClass);
    Preondition Violations
    Unmatched return constructTuplizer(tuplizerClass,metamodel,persistentClass);
    4
    return constructTuplizer(tuplizerClass, metamodel, persistentClass);
    4
    return id;
    4
    return id;
    Preondition Violations
    Unmatched return id;
                              
    Precondition Violations (5)
    Row Violation
    1Type java.lang.Object of variable id does not match with type java.lang.Class of variable tuplizerClass
    2Unmatched throw new HibernateException("could not determine default tuplizer class to use [" + entityMode + "]");
    3Unmatched throw new HibernateException("null identifier column for collection: " + role);
    4Unmatched return constructTuplizer(tuplizerClass,metamodel,persistentClass);
    5Unmatched return id;