try {
boolean result = getResultSet().first();
prepareCurrentRow(result);
return result;
}
catch (SQLException sqle) {
throw JDBCExceptionHelper.convert(
getSession().getFactory().getSQLExceptionConverter(),
sqle,
"could not advance using first()"
);
}
try {
boolean result = getResultSet().last();
prepareCurrentRow(result);
return result;
}
catch (SQLException sqle) {
throw JDBCExceptionHelper.convert(
getSession().getFactory().getSQLExceptionConverter(),
sqle,
"could not advance using last()"
);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/ScrollableResultsImpl.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/ScrollableResultsImpl.java
|
Method name: boolean first()
|
|
Method name: boolean last()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | try {↵ | | 1 | try {↵
|
2 | boolean result = getResultSet().first();↵ | | 2 | boolean result = getResultSet().last();↵
|
3 | prepareCurrentRow(result);↵ | | 3 | prepareCurrentRow(result);↵
|
4 | return result;↵ | | 4 | return result;↵
|
5 | }↵ | | 5 | }↵
|
6 | catch (SQLException sqle) {↵ | | 6 | catch (SQLException sqle) {↵
|
7 | throw JDBCExceptionHelper.convert(↵ | | 7 | throw JDBCExceptionHelper.convert(↵
|
8 | getSession().getFactory().getSQLExceptionConverter(),↵ | | 8 | getSession().getFactory().getSQLExceptionConverter(),↵
|
9 | sqle,↵ | | 9 | sqle,↵
|
10 | "could not advance using first()"↵ | | 10 | "could not advance using last()"↵
|
11 | );↵ | | 11 | );↵
|
12 | } | | 12 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
2 | boolean result = getResultSet().first(); | | 2 | boolean result = getResultSet().last(); |
3 | prepareCurrentRow(result); | | 3 | prepareCurrentRow(result); |
4 | | | 4 | |
Precondition Violations (0)
Row |
Violation |