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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | try | | 1 | try |
3 | _inWidgetSetVisible = true; | | 2 | _dontReactToSessionDropDownAction = true; |
4 | _widget.setVisible(true); | | 3 | _sessionDropDown.setSelectedItem(session); |
Precondition Violations (4)
Row |
Violation |
1 | Expression _widget.setVisible(true) is a void method call, and thus it cannot be parameterized |
2 | Expression _sessionDropDown.setSelectedItem(session) is a void method call, and thus it cannot be parameterized |
3 | 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 |
4 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DialogDelegate and do not have a common superclass |