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 parsePopupMenu(ExtendablePopupMenu, Element)
|
Method name: void parsePopupMenu(ExtendablePopupMenu, Element)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);↵ | 1 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);↵ | |
2 | AbstractColumbaAction action = getAction(id, mediator);↵ | 2 | AbstractColumbaAction action = getAction(id, mediator);↵ | |
3 | if (action == null)↵ | 3 | if (action == null)↵ | |
4 | continue;↵ | 4 | continue;↵ | |
5 | CMenuItem menuItem = new CMenuItem(action);↵ | 5 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action);↵ | |
6 | menuItem.addMouseListener(mediator.getMouseTooltipHandler()); | 6 |
| |
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 in the same method |
Number of node comparisons | 14 |
Number of mapped statements | 6 |
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.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); | 27 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); | |||||||||||||||||||
12 | AbstractColumbaAction action = getAction(id, mediator); | 28 | AbstractColumbaAction action = getAction(id, mediator); | |||||||||||||||||||
13 | if (action == null) | 29 | if (action == null) | |||||||||||||||||||
14 | continue; |
| 30 | continue; | ||||||||||||||||||
15 | CMenuItem menuItem = new CMenuItem(action); |
| 31 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action); | ||||||||||||||||||
16 | menuItem.addMouseListener(mediator.getMouseTooltipHandler()); |
| 32 | menuItem.addMouseListener(mediator.getMouseTooltipHandler()); |
Row | Violation |
---|---|
1 | Statement continue; without innermost loop |
2 | Statement continue; without innermost loop |
3 | Expression new CMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new JRadioButtonMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variable menuItem with type org.columba.core.gui.base.CMenuItem , while Clone fragment #2 returns variable menuItem with type javax.swing.JRadioButtonMenuItem |