if ( resultSet == null ) {
return;
}
try {
resultSet.close();
}
catch ( SQLException e ) {
// ignore
}
if ( statement == null ) {
return;
}
try {
statement.close();
}
catch ( SQLException e ) {
// ignore
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/jdbc/GeneralWorkTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/jdbc/GeneralWorkTest.java
|
Method name: void releaseQuietly(ResultSet)
|
|
Method name: void releaseQuietly(Statement)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if ( resultSet == null ) {↵ | | 1 | if ( statement == null ) {↵
|
2 | return;↵ | | 2 | return;↵
|
3 | }↵ | | 3 | }↵
|
4 | try {↵ | | 4 | try {↵
|
5 | resultSet.close();↵ | | 5 | statement.close();↵
|
6 | }↵ | | 6 | }↵
|
7 | catch ( SQLException e ) {↵ | | 7 | catch ( SQLException e ) {↵
|
8 | // ignore↵ | | 8 | // ignore↵
|
9 | } | | 9 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
-
{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) | 0.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (resultSet == null) | | 1 | if (statement == null) |
2 | | | 2 | |
3 | try | | 3 | try |
4 | | | 4 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.sql.ResultSet of variable resultSet does not match with type java.sql.Statement of variable statement |
2 | Type java.sql.ResultSet of variable resultSet does not match with type java.sql.Statement of variable statement |