try { _inWidgetSetVisible = true; _widget.setVisible(true); } finally { // _inWidgetSetVisible was introduced to allow moveToFront to be called // from within setVisible. See EditWhereColsSheet or SQLFilterSheet _inWidgetSetVisible = false; }
try { _dontReactToSessionDropDownAction = true; _sessionDropDown.setSelectedItem(session); } finally { _dontReactToSessionDropDownAction = false; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/desktopcontainer/DialogDelegate.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/mainframe/MainFrameToolBar.java
Method name: void _moveToFront() Method name: void run()
Number of AST nodes: 3 Number of AST nodes: 3
1
try
1
try
2
         {
2
         
3
            _inWidgetSetVisible = true;
4
            _widget.setVisible(true
3
      {
4
                  _dontReactToSessionDropDownAction = true;
5
);
5
                  _sessionDropDown.setSelectedItem(session);
6
         }
6
       
7
         finally
7
        }
8
         {
8
         
9
            // _inWidgetSetVisible was introduced to allow moveToFront to be called
9
      
10
            // from within setVisible. See EditWhereColsSheet or SQLFilterSheet
11
            _inWidgetSetVisible
10
finally
11
               {
12
 = false;
12
                  _dontReactToSessionDropDownAction = false;
13
         }
13
               }
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.1
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    1
    try
    Differences
    Expression1Expression2Difference
    _inWidgetSetVisible_dontReactToSessionDropDownActionVARIABLE_NAME_MISMATCH
    1
    try
    3
    _inWidgetSetVisible = true;
    3
    _inWidgetSetVisible = true;
    2
    _dontReactToSessionDropDownAction = true;
    Differences
    Expression1Expression2Difference
    _inWidgetSetVisible_dontReactToSessionDropDownActionVARIABLE_NAME_MISMATCH
    2
    _dontReactToSessionDropDownAction = true;
    4
    _widget.setVisible(true);
    4
    _widget.setVisible(true);
    3
    _sessionDropDown.setSelectedItem(session);
    Differences
    Expression1Expression2Difference
    truesessionAST_TYPE_MISMATCH
    setVisiblesetSelectedItemMETHOD_INVOCATION_NAME_MISMATCH
    _widget_sessionDropDownVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.gui.desktopcontainer.IWidgetnet.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameToolBar.SessionDropDownVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression _widget.setVisible(true) is a void method call, and thus it cannot be parameterized
    Expression _sessionDropDown.setSelectedItem(session) is a void method call, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.IWidget of variable _widget does not match with type net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameToolBar.SessionDropDown of variable _sessionDropDown
    • Make classes net.sourceforge.squirrel_sql.client.gui.desktopcontainer.IWidget and net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameToolBar.SessionDropDown extend a common superclass
    3
    _sessionDropDown.setSelectedItem(session);
    Precondition Violations (4)
    Row Violation
    1Expression _widget.setVisible(true) is a void method call, and thus it cannot be parameterized
    2Expression _sessionDropDown.setSelectedItem(session) is a void method call, and thus it cannot be parameterized
    3Type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.IWidget of variable _widget does not match with type net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrameToolBar.SessionDropDown of variable _sessionDropDown
    4The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DialogDelegate and do not have a common superclass