public class HSQLBigDecimalTest { String jdbcUrl = "jdbc:hsqldb:file:/tools/hsqldb-1_8_0_2/data/dbcopydest"; String user = "sa"; String pass = ""; Connection con = null; String testSQL = "select nr from test"; public HSQLBigDecimalTest() throws Exception { init(); } public void init() throws Exception { Class.forName("org.hsqldb.jdbcDriver"); con = DriverManager.getConnection(jdbcUrl,user, pass); } /** * This fails with a Connection failure - java.io.EOFException * @throws SQLException */ public void doTest() throws SQLException { Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(testSQL); if (rs.next()) { BigDecimal d = rs.getBigDecimal(1); System.out.println("d="+d); } stmt.close(); } public void shutdown() throws SQLException { con.close(); } /** * @param args */ public static void main(String[] args) throws Exception { PointbaseBLOBTest test = new PointbaseBLOBTest(); test.doTest(); test.shutdown();
public class MySQLDecimalTest { String jdbcUrl = "jdbc:hsqldb:file:/tools/hsqldb-1_8_0_2/data/dbcopydest"; String user = "sa"; String pass = ""; Connection con = null; String testSQL = "select nr from test"; public MySQLDecimalTest() throws Exception { init(); } public void init() throws Exception { Class.forName("org.hsqldb.jdbcDriver"); con = DriverManager.getConnection(jdbcUrl,user, pass); } /** * This fails with a Connection failure - java.io.EOFException * @throws SQLException */ public void doTest() throws SQLException { Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(testSQL); if (rs.next()) { BigDecimal d = rs.getBigDecimal(1); System.out.println("d="+d); } stmt.close(); } public void shutdown() throws SQLException { con.close(); } /** * @param args */ public static void main(String[] args) throws Exception { PointbaseBLOBTest test = new PointbaseBLOBTest(); test.doTest(); test.shutdown();
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbcopy/test/adhoc/HSQLBigDecimalTest.java File path: /sql12/plugins/dbcopy/test/adhoc/MySQLDecimalTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class HSQLBigDecimalTest {
1
public class MySQLDecimalTest {
2
    String jdbcUrl = "jdbc:hsqldb:file:/tools/hsqldb-1_8_0_2/data/dbcopydest";
2
    String jdbcUrl = "jdbc:hsqldb:file:/tools/hsqldb-1_8_0_2/data/dbcopydest";
3
    
3
    
4
    String user = "sa";
4
    String user = "sa";
5
    
5
    
6
    String pass = "";
6
    String pass = "";
7
    
7
    
8
    Connection con = null;
8
    Connection con = null;
9
    
9
    
10
    String testSQL = 
10
    String testSQL = 
11
        "select nr from test";
11
        "select nr from test";
12
    
12
    
13
    public HSQLBigDecimalTest() throws Exception {
13
    public MySQLDecimalTest() throws Exception {
14
        init();
14
        init();
15
    }
15
    }
16
    
16
    
17
    public void init() throws Exception {
17
    public void init() throws Exception {
18
        Class.forName("org.hsqldb.jdbcDriver");
18
        Class.forName("org.hsqldb.jdbcDriver");
19
        con = DriverManager.getConnection(jdbcUrl,user, pass);
19
        con = DriverManager.getConnection(jdbcUrl,user, pass);
20
    }
20
    }
21
    
21
    
22
    /**
22
    /**
23
     * This fails with a Connection failure - java.io.EOFException
23
     * This fails with a Connection failure - java.io.EOFException
24
     * @throws SQLException
24
     * @throws SQLException
25
     */
25
     */
26
    public void doTest() throws SQLException {
26
    public void doTest() throws SQLException {
27
        Statement stmt = con.createStatement();
27
        Statement stmt = con.createStatement();
28
        ResultSet rs = stmt.executeQuery(testSQL);
28
        ResultSet rs = stmt.executeQuery(testSQL);
29
        if (rs.next()) {
29
        if (rs.next()) {
30
            BigDecimal d = rs.getBigDecimal(1);
30
            BigDecimal d = rs.getBigDecimal(1);
31
            System.out.println("d="+d);
31
            System.out.println("d="+d);
32
        }
32
        }
33
        stmt.close();
33
        stmt.close();
34
    }
34
    }
35
    
35
    
36
    public void shutdown() throws SQLException {
36
    public void shutdown() throws SQLException {
37
        con.close();
37
        con.close();
38
    }
38
    }
39
    
39
    
40
    /**
40
    /**
41
     * @param args
41
     * @param args
42
     */
42
     */
43
    public static void main(String[] args) throws Exception {
43
    public static void main(String[] args) throws Exception {
44
        PointbaseBLOBTest test = new PointbaseBLOBTest();
44
        PointbaseBLOBTest test = new PointbaseBLOBTest();
45
        
45
        
46
        test.doTest();
46
        test.doTest();
47
        
47
        
48
        test.shutdown();
48
        test.shutdown();
49
    
49
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0