try {
ups.setInt( 1, result + 1 );
ups.setInt( 2, result );
//ups.setString( 3, key );
rows = ups.executeUpdate();
}
catch (SQLException sqle) {
log.error("could not update hi value in: " + tableName, sqle);
throw sqle;
}
finally {
ups.close();
}
try {
ups.setInt( 1, result + 1 );
ups.setInt( 2, result );
rows = ups.executeUpdate();
}
catch (SQLException sqle) {
log.error("could not update hi value in: " + tableName, sqle);
throw sqle;
}
finally {
ups.close();
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/TableGenerator.java
|
Method name: Serializable doWorkInCurrentTransaction(Connection, String)
|
|
Method name: Serializable doWorkInCurrentTransaction(Connection, String)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | try {↵ | | 1 | try {↵
|
2 | ups.setInt( 1, result + 1 );↵ | | 2 | ups.setInt( 1, result + 1 );↵
|
3 | ups.setInt( 2, result );↵ | | 3 | ups.setInt( 2, result );↵
|
4 | //ups.setString( 3, key );↵ | | 4 | ↵
|
5 | rows = ups.executeUpdate();↵ | | 5 | rows = ups.executeUpdate();↵
|
6 | }↵ | | 6 | }↵
|
7 | catch (SQLException sqle) {↵ | | 7 | catch (SQLException sqle) {↵
|
8 | log.error("could not update hi value in: " + tableName, sqle);↵ | | 8 | log.error("could not update hi value in: " + tableName, sqle);↵
|
9 | throw sqle;↵ | | 9 | throw sqle;↵
|
10 | }↵ | | 10 | }↵
|
11 | finally {↵ | | 11 | finally {↵
|
12 | ups.close();↵ | | 12 | ups.close();↵
|
13 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
-
{Non-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) | 2.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | try | | 17 | try |
18 | ups.setInt(1, result + 1); | | 18 | ups.setInt(1, result + 1); |
19 | | | 19 | |
20 | rows = ups.executeUpdate(); | | 20 | rows = ups.executeUpdate(); |
Precondition Violations (1)
Row |
Violation |
1 | The refactoring of the clones is infeasible, because classes org.hibernate.id.MultipleHiLoPerTableGenerator and org.hibernate.id.TableGenerator do not have a common superclass |