ITableInfo ti = (ITableInfo) dbObjs[i]; /////////////////////////////////////////////////////////// // IBM DB 2 specific code to read view definitions. String sql = "SELECT TEXT " + "FROM SYSIBM.SYSVIEWS " + "WHERE NAME = '" + ti.getSimpleName() + "'"; ResultSet res = stat.executeQuery(sql); res.next(); script.append(res.getString("TEXT")); script.append(getStatementSeparator()); res.close();
IProcedureInfo pi = (IProcedureInfo) dbObjs[i]; /////////////////////////////////////////////////////////// // SybaseASE specific code to read procedure definitions. String sql = "Select text " + "from sysobjects inner join syscomments on syscomments.id = sysobjects.id " + "where name = '" + pi.getSimpleName().replace(";1", "") + "'"; ResultSet res = stat.executeQuery(sql); while(res.next()) { script.append(res.getString("text")); } script.append(getStatementSeparator()); res.close();
Clone fragments detected by clone detection tool
File path: /sql12/plugins/example/src/net/sourceforge/squirrel_sql/plugins/example/ScriptDB2ViewAction.java File path: /sql12/plugins/sybase/src/net/sourceforge/squirrel_sql/plugins/SybaseASE/ScriptSybaseASEProcedureAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 7 Number of AST nodes: 7
1
ITableInfo ti = (ITableInfo) dbObjs[i];
1
IProcedureInfo pi = (IProcedureInfo) dbObjs[i];
2
            ///////////////////////////////////////////////////////////
2
            ///////////////////////////////////////////////////////////
3
            // IBM DB 2 specific code to read view definitions.
3
            // SybaseASE specific code to read procedure definitions.
4
            String sql =
4
            String sql =
5
               "SELECT TEXT " +
5
                "Select text " +
6
               "FROM SYSIBM.SYSVIEWS " +
6
                "from sysobjects inner join syscomments on syscomments.id = sysobjects.id " +
7
               "WHERE NAME = '" + ti.getSimpleName() + "'";
7
                "where name = '" + pi.getSimpleName().replace(";1", "") + "'";
8
            ResultSet res = stat.executeQuery(sql);
8
             ResultSet res = stat.executeQuery(sql);
9
            res.next();
9
             while(res.next()
10
)
11
             {
10
            script.append(res.getString("TEXT"));
12
                 script.append(res.getString("
13
text"));            
14
             }
11
            script.append(getStatementSeparator());
15
             script.append(getStatementSeparator());
12
            res.close();
16
             res.close();
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 locationClones are in different classes having the same super class
Number of node comparisons15