JMenuItem newMenuChoice = new JMenuItem(label); newMenuChoice.setName(name); newMenuChoice.addActionListener(ActionRouter.getInstance()); if (actionCommand != null) { newMenuChoice.setActionCommand(actionCommand); } return newMenuChoice;
JMenuItem newMenuChoice = new JMenuItem(label); newMenuChoice.setName(name); newMenuChoice.addActionListener(ReportActionRouter.getInstance()); if (actionCommand != null) { newMenuChoice.setActionCommand(actionCommand); } return newMenuChoice;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/MenuFactory.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuFactory.java
Method name: JMenuItem makeMenuItem(String, String, String) Method name: JMenuItem makeMenuItem(String, String, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
JMenuItem newMenuChoice = new JMenuItem(label);
1
JMenuItem newMenuChoice = new JMenuItem(label);
2
		newMenuChoice.setName(name);
2
		newMenuChoice.setName(name);
3
		newMenuChoice.addActionListener(ActionRouter.getInstance());
3
		newMenuChoice.addActionListener(ReportActionRouter.getInstance());
4
		if (actionCommand != null) {
4
		if (actionCommand != null) {
5
			newMenuChoice.setActionCommand(actionCommand);
5
			newMenuChoice.setActionCommand(actionCommand);
6
		}
6
		}
7
		return newMenuChoice;
7
		return newMenuChoice;
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.1
Clones locationClones are in different classes
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)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    JMenuItem newMenuChoice = new JMenuItem(label);
    1
    JMenuItem newMenuChoice = new JMenuItem(label);
    2
    newMenuChoice.setName(name);
    2
    newMenuChoice.setName(name);
    3
    newMenuChoice.addActionListener(ActionRouter.getInstance());
    3
    newMenuChoice.addActionListener(ActionRouter.getInstance());
    3
    newMenuChoice.addActionListener(ReportActionRouter.getInstance());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.action.ActionRouterorg.apache.jmeter.report.gui.action.ReportActionRouterSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression ActionRouter cannot be unified with expression ReportActionRouter , because common superclass java.awt.event.ActionListener does not declare member(s) public static org.apache.jmeter.gui.action.ActionRouter getInstance() , public static org.apache.jmeter.report.gui.action.ReportActionRouter getInstance()
    3
    newMenuChoice.addActionListener(ReportActionRouter.getInstance());
    4
    if (actionCommand != null)
    4
    if (actionCommand != null)
    5
    newMenuChoice.setActionCommand(actionCommand);
    5
    newMenuChoice.setActionCommand(actionCommand);
    6
    return newMenuChoice;
    6
    return newMenuChoice;
    Precondition Violations (1)
    Row Violation
    1Expression ActionRouter cannot be unified with expression ReportActionRouter , because common superclass java.awt.event.ActionListener does not declare member(s) public static org.apache.jmeter.gui.action.ActionRouter getInstance() , public static org.apache.jmeter.report.gui.action.ReportActionRouter getInstance()