public class SnapshotSourceTab extends OracleSourceTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(SnapshotSourceTab.class); /** SQL that retrieves the data. */ private static final String SQL = "SELECT 'CREATE MATERIALIZED VIEW ' || TABLE_NAME || ' AS ', QUERY " + "FROM SYS.ALL_SNAPSHOTS " + "WHERE OWNER = ? AND TABLE_NAME = ? "; public SnapshotSourceTab() { // i18n[oracle.displaySnapshotDetails=Display materialized view details] super(s_stringMgr.getString("oracle.displaySnapshotDetails")); super.sourceType = OracleSourceTab.TABLE_TYPE; } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt
public class TriggerSourceTab extends BaseSourceTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(TriggerSourceTab.class); /** SQL that retrieves the source of a stored procedure. */ private static String SQL = "select trigger_body from sys.all_triggers" + " where owner = ? and trigger_name = ?"; public TriggerSourceTab() { // i18n[oracle.showTriggerSource=Show trigger source] super(s_stringMgr.getString("oracle.showTriggerSource")); } protected PreparedStatement createStatement() throws SQLException { final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); ISQLConnection conn = session.getSQLConnection(); PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt
Clone fragments detected by clone detection tool
File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/SnapshotSourceTab.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/TriggerSourceTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class SnapshotSourceTab extends OracleSourceTab
1
public class TriggerSourceTab extends BaseSourceTab
2
{
2
{
3
	private static final StringManager s_stringMgr =
3
	private static final StringManager s_stringMgr =
4
		StringManagerFactory.getStringManager(SnapshotSourceTab.class);
4
		StringManagerFactory.getStringManager(TriggerSourceTab.class);
5
	/** SQL that retrieves the data. */
5
	/** SQL that retrieves the source of a stored procedure. */
6
	private static final String SQL =
6
	private static String SQL =
7
        "SELECT 'CREATE MATERIALIZED VIEW ' || TABLE_NAME || ' AS ', QUERY " +
8
        "FROM SYS.ALL_SNAPSHOTS " +
9
        "WHERE OWNER = ? AND TABLE_NAME
7
		"select trigger_body from sys.all_triggers"
10
 = ? ";
8
			+ " where owner = ? and trigger_name = ?";
11
    
12
	public SnapshotSourceTab()
9
	public TriggerSourceTab()
13
	{
10
	{
14
		// i18n[oracle.displaySnapshotDetails=Display materialized view details]
11
		// i18n[oracle.
15
		super(s_stringMgr.getString("oracle.displaySnapshotDetails"));
16
        super.sourceType = OracleSourceTab.TABLE_TYPE
12
showTriggerSource=Show trigger source]
17
;
13
		super(s_stringMgr.getString("oracle.showTriggerSource"));
18
	}
14
	}
19
	protected PreparedStatement createStatement() throws SQLException
15
	protected PreparedStatement createStatement() throws SQLException
20
	{
16
	{
21
		ISession session = getSession();
17
		final ISession session = getSession();
22
		PreparedStatement pstmt
18
		final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
23
 = session.getSQLConnection().p
19
		ISQLConnection conn = session.getSQLConnection();
24
repareStatement(SQL);
20
		PreparedStatement
25
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
21
 pstmt = conn.prepareStatement(SQL);
26
		pstmt.setString(1, doi.getSchemaName());
22
		pstmt.setString(1, doi.getSchemaName());
27
		pstmt.setString(2, doi.getSimpleName());
23
		pstmt.setString(2, doi.getSimpleName());
28
		return pstmt
24
		return pstmt
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