if (widget instanceof SessionInternalFrame) { SessionInternalFrame sif = (SessionInternalFrame) widget; sif.getObjectTreeAPI().refreshSelectedNodes(); }
if (tab != null) { if (tab instanceof BaseDataSetTab) { BaseDataSetTab btab = (BaseDataSetTab) tab; btab.refreshComponent(); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionPropertiesSheet.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/ObjectTreePanel.java
Method name: void performOk() Method name: void refreshSelectedTab()
Number of AST nodes: 3 Number of AST nodes: 4
1
if (widget instanceof SessionInternalFrame)
1
if (
2
                     {
3
                        SessionInternalFrame sif =
4
                           (SessionInternalFrame) widget;
5
                        sif.getObjectTreeAPI().refreshSelectedNodes
2
tab != null) {
3
                if (tab instanceof BaseDataSetTab) {
4
                    BaseDataSetTab btab = (BaseDataSetTab) tab;
6
();
5
                    btab.refreshComponent();
7
         
6
                }
8
            }
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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    15
    if (widget instanceof SessionInternalFrame)
    15
    if (widget instanceof SessionInternalFrame)
    4
    if (tab instanceof BaseDataSetTab)
    Differences
    Expression1Expression2Difference
    widgettabVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidgetnet.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTabVARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFramenet.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTabVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget of variable widget does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTab of variable tab
    • Make classes net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTab extend a common superclass
    Type net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab
    • Make classes net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab extend a common superclass
    4
    if (tab instanceof BaseDataSetTab)
                                                                                          
    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;
                                                          
    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();
    16
    SessionInternalFrame sif = (SessionInternalFrame)widget;
    16
    SessionInternalFrame sif = (SessionInternalFrame)widget;
    Preondition Violations
    Unmatched statement SessionInternalFrame sif=(SessionInternalFrame)widget; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                        
    17
    sif.getObjectTreeAPI().refreshSelectedNodes();
                                                                                                        
    Precondition Violations (7)
    Row Violation
    1Type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget of variable widget does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.IObjectTab of variable tab
    2Type net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame does not match with type net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseDataSetTab
    3Unmatched statement BaseDataSetTab btab=(BaseDataSetTab)tab; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement btab.refreshComponent(); 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 or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6Unmatched statement SessionInternalFrame sif=(SessionInternalFrame)widget; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero