String header = propertyName != null ? StringHelper.unqualify( propertyName ) : propertyTableName; if (header == null) throw new AssertionFailure("NammingStrategy not properly filled"); return columnName( header );
Object id = getIdentifierType().nullSafeGet( rs, alias, session, null ); if ( id == null ) { throw new HibernateException( "null identifier column for collection: " + role ); } return id;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/DefaultNamingStrategy.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
Method name: String foreignKeyColumnName(String, String, String, String) Method name: Object readIdentifier(ResultSet, String, SessionImplementor)
Number of AST nodes: 4 Number of AST nodes: 4
1
String header = propertyName != null ? StringHelper.unqualify( propertyName ) : propertyTableName;
1
Object id = getIdentifierType().nullSafeGet( rs, alias, session, null );
2
		if (header == null) 
2
		if ( id == null ) {
3
throw new AssertionFailure("NammingStrategy not properly filled");
3
			throw new 
4
		return columnName( header )
4
HibernateException( "null identifier column for collection: " + role );
5
		}
5
;
6
		return id;
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 statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                            
    1
    Object id = getIdentifierType().nullSafeGet(rs, alias, session, null);
    1
    String header = propertyName != null ? StringHelper.unqualify(propertyName) : propertyTableName;
                                                                                                                                                                                                      
    2
    if (header == null)
    2
    if (header == null)
    2
    if (id == null)
    Differences
    Expression1Expression2Difference
    headeridVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable header does not match with type java.lang.Object of variable id
    • Make classes java.lang.String and java.lang.Object extend a common superclass
    2
    if (id == null)
    3
    throw new AssertionFailure("NammingStrategy not properly filled");
    3
    throw new AssertionFailure("NammingStrategy not properly filled");
    3
    throw new HibernateException("null identifier column for collection: " + role);
    Differences
    Expression1Expression2Difference
    org.hibernate.AssertionFailureorg.hibernate.HibernateExceptionSUBCLASS_TYPE_MISMATCH
    "NammingStrategy not properly filled""null identifier column for collection: " + roleTYPE_COMPATIBLE_REPLACEMENT
    3
    throw new HibernateException("null identifier column for collection: " + role);
                              
    4
    return id;
    Preondition Violations
    Unmatched return id;
    4
    return id;
    4
    return columnName(header);
    4
    return columnName(header);
    Preondition Violations
    Unmatched return columnName(header);
                                                              
    Precondition Violations (3)
    Row Violation
    1Type java.lang.String of variable header does not match with type java.lang.Object of variable id
    2Unmatched return id;
    3Unmatched return columnName(header);