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) {}
}
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: 4
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | |
|
2 | stmt = con.createStatement();↵ | | 1 | stmt = con.createStatement();↵
|
3 | System.out.println("Executing sql: "+sql);↵ | | 2 | System.out.println("Executing sql: " + sql);↵
|
4 | stmt.execute(sql);↵ | | 3 | stmt.execute(sql);
|
5 | } catch (SQLException e ) {↵ | | | |
6 | if (printError) {↵ | | | |
7 | e.printStackTrace();↵ | | | |
8 | }↵ | | | |
9 | } finally {↵ | | | |
10 | if (stmt != null) try { stmt.close(); } catch (SQLException e) {}↵ | | | |
11 | } | | | |
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 | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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 |
3 | stmt = con.createStatement(); | | 3 | stmt = con.createStatement(); |
4 | System.out.println("Executing sql: " + sql); | | 4 | System.out.println("Executing sql: " + sql); |
5 | stmt.execute(sql); | | 5 | stmt.execute(sql); |
Precondition Violations (0)
Row |
Violation |