if (action == null) {
throw new IllegalArgumentException("action cannot be null");
}
_popupMenu.add(action);
if (menu == null)
{
throw new IllegalArgumentException("Menu == null");
}
_textPopupMenu.add(menu);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/MessagePanel.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/BaseSQLEntryPanel.java
|
Method name: void addToMessagePanelPopup(Action)
|
|
Method name: void addToSQLEntryAreaMenu(JMenu)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (action == null) {↵ | | 1 | if (menu == null)↵
|
2 | ↵ | | |
|
| | | 2 | {↵
|
3 | throw new IllegalArgumentException("action cannot be null");↵ | | 3 | throw new IllegalArgumentException("↵
|
4 | }↵ | | |
|
5 | _p↵ | | 4 | Menu == null");↵
|
| | | 5 | }↵
|
|
6 | opupMenu.add(action); | | 6 | _textPopupMenu.add(menu);
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{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) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (action == null) | | 1 | if (menu == null) |
2 | throw new IllegalArgumentException("action cannot be null"); | | 2 | throw new IllegalArgumentException("Menu == null"); |
3 | _popupMenu.add(action); | | 3 | _textPopupMenu.add(menu); |
Precondition Violations (3)
Row |
Violation |
1 | Type javax.swing.Action of variable action does not match with type javax.swing.JMenu of variable menu |
2 | Type javax.swing.Action of variable action does not match with type javax.swing.JMenu of variable menu |
3 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.MessagePanel and net.sourceforge.squirrel_sql.client.session.BaseSQLEntryPanel do not have a common superclass |