if(session.getActiveSessionWindow() instanceof SessionInternalFrame)
{
sqlEntryPanel = ((SessionInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();
}
else if(session.getActiveSessionWindow() instanceof SQLInternalFrame)
{
sqlEntryPanel = ((SQLInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();
}
else
{
return;
}
if (session.getActiveSessionWindow() instanceof SessionInternalFrame)
{
sqlEntryPanel = ((SessionInternalFrame) session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();
}
else if (session.getActiveSessionWindow() instanceof SQLInternalFrame)
{
sqlEntryPanel = ((SQLInternalFrame) session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();
}
else
{
return;
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/sqlbookmark/src/net/sourceforge/squirrel_sql/plugins/sqlbookmark/AddBookmarkCommand.java
|
|
File path: /sql12/plugins/sqlbookmark/src/net/sourceforge/squirrel_sql/plugins/sqlbookmark/RunBookmarkAction.java
|
Method name: void execute()
|
|
Method name: void actionPerformed(ActionEvent)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if(session.getActiveSessionWindow() instanceof SessionInternalFrame)↵ | | 1 | if (session.getActiveSessionWindow() instanceof SessionInternalFrame)↵
|
2 | {↵ | | 2 | ↵
|
| | | 3 | {↵
|
3 | sqlEntryPanel = ((SessionInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();↵ | | 4 | sqlEntryPanel = ((SessionInternalFrame) session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();↵
|
4 | }↵ | | 5 | ↵
|
| | | 6 | }↵
|
5 | else if(session.getActiveSessionWindow() instanceof SQLInternalFrame)↵ | | 7 | else if (session.getActiveSessionWindow() instanceof SQLInternalFrame)↵
|
6 | {↵ | | 8 | ↵
|
| | | 9 | {↵
|
7 | sqlEntryPanel = ((SQLInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();↵ | | 10 | sqlEntryPanel = ((SQLInternalFrame) session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel();↵
|
8 | }↵ | | 11 | }↵
|
9 | else↵ | | 12 | else↵
|
10 | {↵ | | 13 | ↵
|
| | | 14 | {↵
|
11 | return;↵ | | 15 | return;↵
|
12 | } | | 16 | }
|
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.6 |
Clones location | Clones are in different classes |
Number of node comparisons | 20 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 1.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (session.getActiveSessionWindow() instanceof SessionInternalFrame) | | 7 | if (session.getActiveSessionWindow() instanceof SessionInternalFrame) |
5 | sqlEntryPanel = ((SessionInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel(); | | 8 | sqlEntryPanel = ((SessionInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel(); |
6 | else if (session.getActiveSessionWindow() instanceof SQLInternalFrame) | | 9 | else if (session.getActiveSessionWindow() instanceof SQLInternalFrame) |
7 | sqlEntryPanel = ((SQLInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel(); | | 10 | sqlEntryPanel = ((SQLInternalFrame)session.getActiveSessionWindow()).getSQLPanelAPI().getSQLEntryPanel(); |
| | | | |
8 | | | 11 | |
Precondition Violations (3)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |
3 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.sqlbookmark.AddBookmarkCommand and net.sourceforge.squirrel_sql.plugins.sqlbookmark.RunBookmarkAction do not have a common superclass |