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)1.1
    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.ReportActionRouterVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.gui.action.ActionRouterorg.apache.jmeter.report.gui.action.ReportActionRouterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance()
    • Make classes org.apache.jmeter.gui.action.ActionRouter and org.apache.jmeter.report.gui.action.ReportActionRouter extend a common superclass
    Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter
    • Make classes org.apache.jmeter.gui.action.ActionRouter and org.apache.jmeter.report.gui.action.ReportActionRouter extend a common superclass
    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 (2)
    Row Violation
    1Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance() does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance()
    2Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter