if ( holderInstantiator!=null ) {
throw new HibernateException("query specifies a holder class");
}
if ( returnType.getReturnedClass()==types[col].getReturnedClass() ) {
return get(col);
}
else {
return throwInvalidColumnTypeException(col, types[col], returnType);
}
if ( holderInstantiator!=null ) {
throw new HibernateException("query specifies a holder class");
}
if ( returnType.getReturnedClass().isAssignableFrom( types[col].getReturnedClass() ) ) {
return get(col);
}
else {
return throwInvalidColumnTypeException(col, types[col], returnType);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/AbstractScrollableResults.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/AbstractScrollableResults.java
|
Method name: Object getFinal(int, Type)
|
|
Method name: Object getNonFinal(int, Type)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ( holderInstantiator!=null ) {↵ | | 1 | if ( holderInstantiator!=null ) {↵
|
2 | throw new HibernateException("query specifies a holder class");↵ | | 2 | throw new HibernateException("query specifies a holder class");↵
|
3 | }↵ | | 3 | }↵
|
4 | ↵ | | 4 | ↵
|
5 | if ( returnType.getReturnedClass()==types[col].getReturnedClass() ) {↵ | | 5 | if ( returnType.getReturnedClass().isAssignableFrom( types[col].getReturnedClass() ) ) {↵
|
6 | return get(col);↵ | | 6 | return get(col);↵
|
7 | }↵ | | 7 | }↵
|
8 | else {↵ | | 8 | else {↵
|
9 | return throwInvalidColumnTypeException(col, types[col], returnType);↵ | | 9 | return throwInvalidColumnTypeException(col, types[col], returnType);↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 7 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (holderInstantiator != null) | | 1 | if (holderInstantiator != null) |
2 | throw new HibernateException("query specifies a holder class"); | | 2 | throw new HibernateException("query specifies a holder class"); |
Precondition Violations (0)
Row |
Violation |