String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); AbstractColumbaAction action = getAction(id, mediator); if (action == null) continue; JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action); menuItem.addMouseListener(mediator.getMouseTooltipHandler());
String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); AbstractColumbaAction action = getAction(id, mediator); if (action == null) continue; CMenuItem menuItem = new CMenuItem(action); menuItem.addMouseListener(mediator.getMouseTooltipHandler());
Clone fragments detected by clone detection tool
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 parseMenu(ExtendableMenu, 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
				JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action);
5
				CMenuItem menuItem = new CMenuItem(action);
6
				menuItem.addMouseListener(mediator.getMouseTooltipHandler());
6
				menuItem.addMouseListener(mediator.getMouseTooltipHandler());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)11.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    27
    String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);
    11
    String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);
    28
    AbstractColumbaAction action = getAction(id, mediator);
    12
    AbstractColumbaAction action = getAction(id, mediator);
    29
    if (action == null)
    13
    if (action == null)
    30
    continue;
    30
    continue;
    14
    continue;
    Preondition Violations
    Statement continue; without innermost loop
    Statement continue; without innermost loop
    14
    continue;
    31
    JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action);
    31
    JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action);
    15
    CMenuItem menuItem = new CMenuItem(action);
    Differences
    Expression1Expression2Difference
    javax.swing.JRadioButtonMenuItemorg.columba.core.gui.base.CMenuItemSUBCLASS_TYPE_MISMATCH
    javax.swing.JRadioButtonMenuItemorg.columba.core.gui.base.CMenuItemSUBCLASS_TYPE_MISMATCH
    javax.swing.JRadioButtonMenuItemorg.columba.core.gui.base.CMenuItemSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new JRadioButtonMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new CMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15
    CMenuItem menuItem = new CMenuItem(action);
    32
    menuItem.addMouseListener(mediator.getMouseTooltipHandler());
    32
    menuItem.addMouseListener(mediator.getMouseTooltipHandler());
    16
    menuItem.addMouseListener(mediator.getMouseTooltipHandler());
    Differences
    Expression1Expression2Difference
    javax.swing.JRadioButtonMenuItemorg.columba.core.gui.base.CMenuItemSUBCLASS_TYPE_MISMATCH
    16
    menuItem.addMouseListener(mediator.getMouseTooltipHandler());
    Precondition Violations (5)
    Row Violation
    1Statement continue; without innermost loop
    2Statement continue; without innermost loop
    3Expression new JRadioButtonMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new CMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variable menuItem with type javax.swing.JRadioButtonMenuItem , while Clone fragment #2 returns variable menuItem with type org.columba.core.gui.base.CMenuItem