EntityPersister persister = factory.getEntityPersister( entityName ); if ( !(persister instanceof SQLLoadable) ) { throw new MappingException( "class persister is not SQLLoadable: " + entityName ); } return (SQLLoadable) persister;
EntityPersister persister = factory.getEntityPersister(entityName); if ( !(persister instanceof OuterJoinLoadable) ) { throw new MappingException( "class persister is not OuterJoinLoadable: " + entityName ); } return ( OuterJoinLoadable ) persister;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryReturnProcessor.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/StatelessSessionImpl.java
Method name: SQLLoadable getSQLLoadable(String) Method name: OuterJoinLoadable getOuterJoinLoadable(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
EntityPersister persister = factory.getEntityPersister( entityName );
1
EntityPersister persister = factory.getEntityPersister(entityName);
2
		if ( !(persister instanceof SQLLoadable) ) {
2
		if ( !(persister instanceof OuterJoinLoadable) ) {
3
			throw new MappingException( "class persister is not SQLLoadable: " + entityName );
3
			throw new MappingException( "class persister is not OuterJoinLoadable: " + entityName );
4
		}
4
		}
5
		return (SQLLoadable) persister;
5
		return ( OuterJoinLoadable ) persister;
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 statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EntityPersister persister = factory.getEntityPersister(entityName);
    1
    EntityPersister persister = factory.getEntityPersister(entityName);
    1
    EntityPersister persister = factory.getEntityPersister(entityName);
    Differences
    Expression1Expression2Difference
    org.hibernate.engine.SessionFactoryImplementororg.hibernate.impl.SessionFactoryImplVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.engine.SessionFactoryImplementor of variable factory does not match with type org.hibernate.impl.SessionFactoryImpl of variable factory
    • Make classes org.hibernate.engine.SessionFactoryImplementor and org.hibernate.impl.SessionFactoryImpl extend a common superclass
    1
    EntityPersister persister = factory.getEntityPersister(entityName);
    2
    if (!(persister instanceof SQLLoadable))
    2
    if (!(persister instanceof SQLLoadable))
    2
    if (!(persister instanceof OuterJoinLoadable))
    Differences
    Expression1Expression2Difference
    org.hibernate.persister.entity.SQLLoadableorg.hibernate.persister.entity.OuterJoinLoadableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression persister instanceof SQLLoadable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression persister instanceof OuterJoinLoadable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type boolean of variable persister instanceof SQLLoadable does not match with type boolean of variable persister instanceof OuterJoinLoadable
    • Make classes org.hibernate.persister.entity.SQLLoadable and org.hibernate.persister.entity.OuterJoinLoadable extend a common superclass
    2
    if (!(persister instanceof OuterJoinLoadable))
    3
    throw new MappingException("class persister is not SQLLoadable: " + entityName);
    3
    throw new MappingException("class persister is not SQLLoadable: " + entityName);
    3
    throw new MappingException("class persister is not OuterJoinLoadable: " + entityName);
    Differences
    Expression1Expression2Difference
    "class persister is not SQLLoadable: ""class persister is not OuterJoinLoadable: "LITERAL_VALUE_MISMATCH
    3
    throw new MappingException("class persister is not OuterJoinLoadable: " + entityName);
                                                                                  
    4
    return (OuterJoinLoadable)persister;
    4
    return (SQLLoadable)persister;
                                                                      
    Precondition Violations (4)
    Row Violation
    1Type org.hibernate.engine.SessionFactoryImplementor of variable factory does not match with type org.hibernate.impl.SessionFactoryImpl of variable factory
    2Expression persister instanceof SQLLoadable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression persister instanceof OuterJoinLoadable cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type boolean of variable persister instanceof SQLLoadable does not match with type boolean of variable persister instanceof OuterJoinLoadable