public class PrimaryKeyTab extends BaseTableTab { /** Internationalized strings for this class. */ private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(PrimaryKeyTab.class); /** * Return the title for the tab. * * @return The title for the tab. */ public String getTitle() { //i18n[PrimaryKeyTab.title=Primary Key] return s_stringMgr.getString("PrimaryKeyTab.title"); } /** * Return the hint for the tab. * * @return The hint for the tab. */ public String getHint() { //i18n[PrimaryKeyTab.hint=Show primary key for the selected table] return s_stringMgr.getString("PrimaryKeyTab.hint"); } /** * Create the <TT>IDataSet</TT> to be displayed in this tab. */ protected IDataSet createDataSet() throws DataSetException { final ISQLConnection conn = getSession().getSQLConnection(); IDataSet result = null; SQLDatabaseMetaData md = conn.getSQLMetaData(); result = md.getPrimaryKey(getTableInfo(), new int[] { 6, 5, 4 }, true); return result;
public class TablePriviligesTab extends BaseTableTab { /** Internationalized strings for this class. */ private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(TablePriviligesTab.class); private int[] columnIndices = new int[] { 5, 6, 7, 4 }; /** * Return the title for the tab. * * @return The title for the tab. */ public String getTitle() { //i18n[TablePriviligesTab.title=Privileges] return s_stringMgr.getString("TablePriviligesTab.title"); } /** * Return the hint for the tab. * * @return The hint for the tab. */ public String getHint() { //i18n[TablePriviligesTab.hint=Show access rights for the selected table] return s_stringMgr.getString("TablePriviligesTab.hint"); } /** * Create the <TT>IDataSet</TT> to be displayed in this tab. */ protected IDataSet createDataSet() throws DataSetException { final SQLDatabaseMetaData md = getSession().getSQLConnection().getSQLMetaData(); ITableInfo ti = getTableInfo(); return md.getTablePrivilegesDataSet(ti, columnIndices, true);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/PrimaryKeyTab.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/TablePriviligesTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class PrimaryKeyTab extends BaseTableTab
1
public class TablePriviligesTab extends BaseTableTab
2
{
2
{
3
	
3
	
4
    /** Internationalized strings for this class. */
4
    /** Internationalized strings for this class. */
5
    private static final StringManager s_stringMgr =
5
    private static final StringManager s_stringMgr =
6
        StringManagerFactory.getStringManager(PrimaryKeyTab.class);
6
        StringManagerFactory.getStringManager(TablePriviligesTab.class);
7
        		
8
    private int[] columnIndices = new int[] { 5, 6, 7, 4 };
7
    
9
    
8
	/**
10
	/**
9
	 * Return the title for the tab.
11
	 * Return the title for the tab.
10
	 *
12
	 *
11
	 * @return	The title for the tab.
13
	 * @return	The title for the tab.
12
	 */
14
	 */
13
	public String getTitle()
15
	public String getTitle()
14
	{
16
	{
15
		//i18n[PrimaryKeyTab.title=Primary Key]
17
		//i18n[TablePriviligesTab.title=Privileges]
16
		return s_stringMgr.getString("PrimaryKeyTab.title");
18
		return s_stringMgr.getString("TablePriviligesTab.title");
17
	}
19
	}
18
	/**
20
	/**
19
	 * Return the hint for the tab.
21
	 * Return the hint for the tab.
20
	 *
22
	 *
21
	 * @return	The hint for the tab.
23
	 * @return	The hint for the tab.
22
	 */
24
	 */
23
	public String getHint()
25
	public String getHint()
24
	{
26
	{
25
		//i18n[PrimaryKeyTab.hint=Show primary key for the selected table] 
27
		//i18n[TablePriviligesTab.hint=Show access rights for the selected table]
26
		return s_stringMgr.getString("PrimaryKeyTab.hint");
28
		return s_stringMgr.getString("TablePriviligesTab.hint");
27
	}
29
	}
28
	/**
30
	/**
29
	 * Create the <TT>IDataSet</TT> to be displayed in this tab.
31
	 * Create the <TT>IDataSet</TT> to be displayed in this tab.
30
	 */
32
	 */
31
	protected IDataSet createDataSet() throws DataSetException
33
	protected IDataSet createDataSet() throws DataSetException
32
	{
34
	{
33
		final ISQLConnection conn = getSession().getSQLConnection();
35
		final SQL
34
        IDataSet result = null;
35
        SQLDatabaseMetaData md = conn.getSQLMetaData
36
DatabaseMetaData md = 
37
            getSession().getSQLConnection().getSQLMetaData();
36
();
38
        ITableInfo ti = getTableInfo();
37
        result = md.getPrimaryKey(getTableInfo(),
39
        return md.get
38
                                  new int[] { 6, 5, 4 },
39
                                  true);
40
        return result;
40
TablePrivilegesDataSet(ti, columnIndices, true);
41
	
41
	
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