for (IDatabaseObjectInfo dbObj : dbObjs) { if (dbObj instanceof ITableInfo) { ITableInfo ti = (ITableInfo)dbObj; result.add(ti); } }
if (tab != null) { if (tab instanceof BaseDataSetTab) { BaseDataSetTab btab = (BaseDataSetTab) tab; btab.refreshComponent(); } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateTableScriptCommand.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTreePanel.java
Method name: List convertArrayToList(IDatabaseObjectInfo[]) Method name: void refreshSelectedTab()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (IDatabaseObjectInfo dbObj : dbObjs) {
1
if (tab != null) {
2
           if (dbObj instanceof ITableInfo) {
2
                if (tab instanceof BaseDataSetTab) {
3
               ITableInfo ti = (ITableInfo)dbObj;
3
                    BaseDataSetTab btab = (BaseDataSetTab) tab;
4
               result.add(ti);
4
                    btab.refreshComponent();
5
           }
5
            
6
    }
6
       }
7
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (dbObj instanceof ITableInfo)
    3
    if (dbObj instanceof ITableInfo)
    4
    if (tab instanceof BaseDataSetTab)
    Differences
    Expression1Expression2Difference
    dbObjtabVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfonet.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTabVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.fw.sql.ITableInfonet.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTabVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo of variable dbObj does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTab of variable tab
    • Make classes net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTab extend a common superclass
    Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab
    • Make classes net.sourceforge.squirrel_sql.fw.sql.ITableInfo and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab extend a common superclass
    4
    if (tab instanceof BaseDataSetTab)
    4
    ITableInfo ti = (ITableInfo)dbObj;
    4
    ITableInfo ti = (ITableInfo)dbObj;
    Preondition Violations
    Unmatched statement ITableInfo ti=(ITableInfo)dbObj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                          
                                                                                          
    5
    BaseDataSetTab btab = (BaseDataSetTab)tab;
    Preondition Violations
    Unmatched statement BaseDataSetTab btab=(BaseDataSetTab)tab; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    BaseDataSetTab btab = (BaseDataSetTab)tab;
    5
    result.add(ti);
                                        
                                                          
    6
    btab.refreshComponent();
    Preondition Violations
    Unmatched statement btab.refreshComponent(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement btab.refreshComponent(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6
    btab.refreshComponent();
    Precondition Violations (7)
    Row Violation
    1Type net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo of variable dbObj does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTab of variable tab
    2Type net.sourceforge.squirrel_sql.fw.sql.ITableInfo does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab
    3Unmatched statement ITableInfo ti=(ITableInfo)dbObj; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement BaseDataSetTab btab=(BaseDataSetTab)tab; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement btab.refreshComponent(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement btab.refreshComponent(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero