Statement stmt = null;
try {
stmt = con.createStatement();
System.out.println("Executing sql: "+sql);
stmt.execute(sql);
} catch (SQLException e ) {
if (printError) {
e.printStackTrace();
}
} finally {
if (stmt != null) try { stmt.close(); } catch (SQLException e) {}
}
Statement stmt = null;
try
{
stmt = con.createStatement();
System.out.println("Executing sql: " + sql);
stmt.execute(sql);
Clone fragments detected by clone detection tool
File path: /sql12/test/adhoc/test/H2IdentifierQuoteTest.java
|
|
File path: /sql12/test/adhoc/test/IngresMoneyTest.java
|
Method name: void execute(Connection, String, boolean)
|
|
Method name: void execute(Connection, String, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | Statement stmt = null;↵ | | 1 | Statement stmt = null;↵
|
2 | try {↵ | | |
|
3 | ↵ | | 2 | try↵
|
| | | 3 | {↵
|
4 | stmt = con.createStatement();↵ | | 4 | stmt = con.createStatement();↵
|
5 | System.out.println("Executing sql: "+sql);↵ | | 5 | System.out.println("Executing sql: " + sql);↵
|
6 | stmt.execute(sql);↵ | | 6 | stmt.execute(sql);
|
7 | } catch (SQLException e ) {↵ | | | |
8 | if (printError) {↵ | | | |
9 | e.printStackTrace();↵ | | | |
10 | }↵ | | | |
11 | } finally {↵ | | | |
12 | if (stmt != null) try { stmt.close(); } catch (SQLException e) {}↵ | | | |
13 | } | | | |
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
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.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Statement stmt = null; | | 1 | Statement stmt = null; |
Precondition Violations (0)
Row |
Violation |