try { return ( QueryableCollection ) sfi.getCollectionPersister( role ); } catch ( ClassCastException cce ) { throw new QueryException( "collection is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection not found: " + role ); }
try { return ( QueryableCollection ) getFactory().getCollectionPersister( role ); } catch ( ClassCastException cce ) { throw new QueryException( "collection role is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection role not found: " + role ); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/ast/util/SessionFactoryHelper.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/classic/QueryTranslatorImpl.java
Method name: QueryableCollection getCollectionPersister(String) Method name: QueryableCollection getCollectionPersister(String)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
			return ( QueryableCollection ) sfi.getCollectionPersister( role );
2
			return ( QueryableCollection ) getFactory().getCollectionPersister( role );
3
		}
3
		}
4
		catch ( ClassCastException cce ) {
4
		catch ( ClassCastException cce ) {
5
			throw new QueryException( "collection is not queryable: " + role );
5
			throw new QueryException( "collection role is not queryable: " + role );
6
		}
6
		}
7
		catch ( Exception e ) {
7
		catch ( Exception e ) {
8
			throw new QueryException( "collection not found: " + role );
8
			throw new QueryException( "collection role not found: " + role );
9
		}
9
		}
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.3
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)42.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    "collection is not queryable: ""collection role is not queryable: "LITERAL_VALUE_MISMATCH
    "collection not found: ""collection role not found: "LITERAL_VALUE_MISMATCH
    1
    try
    2
    return (QueryableCollection)sfi.getCollectionPersister(role);
    2
    return (QueryableCollection)sfi.getCollectionPersister(role);
    2
    return (QueryableCollection)getFactory().getCollectionPersister(role);
    Differences
    Expression1Expression2Difference
    sfigetFactory()TYPE_COMPATIBLE_REPLACEMENT
    2
    return (QueryableCollection)getFactory().getCollectionPersister(role);
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes org.hibernate.hql.ast.util.SessionFactoryHelper and org.hibernate.hql.classic.QueryTranslatorImpl do not have a common superclass