final MainFrame mf = getMainFrame();
if (mf != null)
{
mf.addToMenu(menuId, menu);
}
else
{
throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));
}
final MainFrame mf = getMainFrame();
if (mf != null)
{
mf.addToMenu(menuId, action);
}
else
{
throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/Application.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/Application.java
|
Method name: void addToMenu(int, JMenu)
|
|
Method name: void addToMenu(int, Action)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | final MainFrame mf = getMainFrame();↵ | | 1 | final MainFrame mf = getMainFrame();↵
|
2 | if (mf != null)↵ | | 2 | if (mf != null)↵
|
3 | {↵ | | 3 | {↵
|
4 | mf.addToMenu(menuId, menu);↵ | | 4 | mf.addToMenu(menuId, action);↵
|
5 | }↵ | | 5 | }↵
|
6 | else↵ | | 6 | else↵
|
7 | {↵ | | 7 | {↵
|
8 | throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));↵ | | 8 | throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));↵
|
9 | } | | 9 | }
|
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 declared in the same class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | final MainFrame mf = getMainFrame(); | | 1 | final MainFrame mf = getMainFrame(); |
2 | if (mf != null) | | 2 | if (mf != null) |
3 | mf.addToMenu(menuId, menu); | | 3 | mf.addToMenu(menuId, action); |
| | | | |
4 | throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding")); | | 4 | throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding")); |
Precondition Violations (1)
Row |
Violation |
1 | Type javax.swing.JMenu of variable menu does not match with type javax.swing.Action of variable action |