File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/MenuXMLDecoder.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/MenuXMLDecoder.java | |||
Method name: void extendMenu(ExtendableMenuBar, ExtendableMenu, Element, String)
|
Method name: void parsePopupMenu(ExtendablePopupMenu, Element)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);↵ | 1 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);↵ | |
2 | AbstractColumbaAction action = getAction(↵ | 2 | AbstractSelectableAction action = (AbstractSelectableAction) getAction(↵ | |
3 | id, mediator);↵ | 3 | id, mediator);↵ | |
4 | if (action == null)↵ | 4 | if (action == null)↵ | |
5 | continue;↵ | 5 | continue;↵ | |
6 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action);↵ | 6 | CCheckBoxMenuItem menuItem = new CCheckBoxMenuItem(action);↵ | |
7 | menuItem.addMouseListener(mediator.getMouseTooltipHandler());↵ | 7 | menuItem.addMouseListener(mediator.getMouseTooltipHandler());↵ | |
8 | parentMenu.insert(menuItem, placeholderId); | 8 | parentMenu.add(menuItem); | |
See real code fragment | See real code fragment |
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 declared in the same class |
Number of node comparisons | 19 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); | 19 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); | ||||||||||||||||||||||
33 | AbstractColumbaAction action = getAction(id, mediator); |
| 20 | AbstractSelectableAction action = (AbstractSelectableAction)getAction(id, mediator); | |||||||||||||||||||||
34 | if (action == null) |
| 21 | if (action == null) | |||||||||||||||||||||
35 | continue; |
| 22 | continue; | |||||||||||||||||||||
36 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action); |
| 23 | CCheckBoxMenuItem menuItem = new CCheckBoxMenuItem(action); | |||||||||||||||||||||
37 | menuItem.addMouseListener(mediator.getMouseTooltipHandler()); |
| 24 | menuItem.addMouseListener(mediator.getMouseTooltipHandler()); | |||||||||||||||||||||
|
| 25 | parentMenu.add(menuItem); | ||||||||||||||||||||||
38 | parentMenu.insert(menuItem, placeholderId); |
| |
Row | Violation |
---|---|
1 | Expression getAction(id,mediator) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (AbstractSelectableAction)getAction(id,mediator) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Statement continue; without innermost loop |
4 | Statement continue; without innermost loop |
5 | Expression new JRadioButtonMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression new CCheckBoxMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement parentMenu.add(menuItem); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement parentMenu.insert(menuItem,placeholderId); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Clone fragment #1 returns variable menuItem with type javax.swing.JRadioButtonMenuItem , while Clone fragment #2 returns variable menuItem with type org.columba.core.gui.action.CCheckBoxMenuItem |