if (remoteHosts.length > 0) { remote_start = new JMenu(JMeterUtils.getResString("remote_start")); remote_stop = new JMenu(JMeterUtils.getResString("remote_stop")); remote_exit = new JMenu(JMeterUtils.getResString("remote_exit")); for (int i = 0; i < remoteHosts.length; i++) { remoteHosts[i] = remoteHosts[i].trim(); JMenuItem item = new JMenuItem(remoteHosts[i]); item.setActionCommand("remote_start"); item.setName(remoteHosts[i]); item.addActionListener(ReportActionRouter.getInstance()); remote_engine_start.add(item); remote_start.add(item); item = new JMenuItem(remoteHosts[i]); item.setActionCommand("remote_stop"); item.setName(remoteHosts[i]); item.addActionListener(ReportActionRouter.getInstance()); item.setEnabled(false); remote_engine_stop.add(item); remote_stop.add(item); item = new JMenuItem(remoteHosts[i]); item.setActionCommand("remote_exit"); item.setName(remoteHosts[i]); item.addActionListener(ReportActionRouter.getInstance()); item.setEnabled(false); remote_engine_exit.add(item); remote_exit.add(item); } }
if (remoteHosts.length > 0) { remote_start = new JMenu(JMeterUtils.getResString("remote_start")); //$NON-NLS-1$ remote_stop = new JMenu(JMeterUtils.getResString("remote_stop")); //$NON-NLS-1$ remote_exit = new JMenu(JMeterUtils.getResString("remote_exit")); //$NON-NLS-1$ for (int i = 0; i < remoteHosts.length; i++) { remoteHosts[i] = remoteHosts[i].trim(); JMenuItem item = new JMenuItem(remoteHosts[i]); item.setActionCommand(ActionNames.REMOTE_START); item.setName(remoteHosts[i]); item.addActionListener(ActionRouter.getInstance()); remote_engine_start.add(item); remote_start.add(item); item = new JMenuItem(remoteHosts[i]); item.setActionCommand(ActionNames.REMOTE_STOP); item.setName(remoteHosts[i]); item.addActionListener(ActionRouter.getInstance()); item.setEnabled(false); remote_engine_stop.add(item); remote_stop.add(item); item = new JMenuItem(remoteHosts[i]); item.setActionCommand(ActionNames.REMOTE_EXIT); item.setName(remoteHosts[i]); item.addActionListener(ActionRouter.getInstance()); item.setEnabled(false); remote_engine_exit.add(item); remote_exit.add(item); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuBar.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/JMeterMenuBar.java
Method name: void getRemoteItems() Method name: void getRemoteItems()
Number of AST nodes: 26 Number of AST nodes: 26
1
if (remoteHosts.length > 0) {
1
if (remoteHosts.length > 0) {
2
			remote_start = new JMenu(JMeterUtils.getResString("remote_start"));
2
			remote_start = new JMenu(JMeterUtils.getResString("remote_start")); //$NON-NLS-1$
3
			remote_stop = new JMenu(JMeterUtils.getResString("remote_stop"));
3
			remote_stop = new JMenu(JMeterUtils.getResString("remote_stop")); //$NON-NLS-1$
4
			remote_exit = new JMenu(JMeterUtils.getResString("remote_exit"));
4
			remote_exit = new JMenu(JMeterUtils.getResString("remote_exit")); //$NON-NLS-1$
5
			for (int i = 0; i < remoteHosts.length; i++) {
5
			for (int i = 0; i < remoteHosts.length; i++) {
6
				remoteHosts[i] = remoteHosts[i].trim();
6
				remoteHosts[i] = remoteHosts[i].trim();
7
				JMenuItem item = new JMenuItem(remoteHosts[i]);
7
				JMenuItem item = new JMenuItem(remoteHosts[i]);
8
				item.setActionCommand("remote_start");
8
				item.setActionCommand(ActionNames.REMOTE_START);
9
				item.setName(remoteHosts[i]);
9
				item.setName(remoteHosts[i]);
10
				item.addActionListener(ReportActionRouter.getInstance());
10
				item.addActionListener(ActionRouter.getInstance());
11
				remote_engine_start.add(item);
11
				remote_engine_start.add(item);
12
				remote_start.add(item);
12
				remote_start.add(item);
13
				item = new JMenuItem(remoteHosts[i]);
13
				item = new JMenuItem(remoteHosts[i]);
14
				item.setActionCommand("remote_stop");
14
				item.setActionCommand(ActionNames.REMOTE_STOP);
15
				item.setName(remoteHosts[i]);
15
				item.setName(remoteHosts[i]);
16
				item.addActionListener(ReportActionRouter.getInstance());
16
				item.addActionListener(ActionRouter.getInstance());
17
				item.setEnabled(false);
17
				item.setEnabled(false);
18
				remote_engine_stop.add(item);
18
				remote_engine_stop.add(item);
19
				remote_stop.add(item);
19
				remote_stop.add(item);
20
				item = new JMenuItem(remoteHosts[i]);
20
				item = new JMenuItem(remoteHosts[i]);
21
				item.setActionCommand("remote_exit");
21
				item.setActionCommand(ActionNames.REMOTE_EXIT);
22
				item.setName(remoteHosts[i]);
22
				item.setName(remoteHosts[i]);
23
				item.addActionListener(ReportActionRouter.getInstance());
23
				item.addActionListener(ActionRouter.getInstance());
24
				item.setEnabled(false);
24
				item.setEnabled(false);
25
				remote_engine_exit.add(item);
25
				remote_engine_exit.add(item);
26
				remote_exit.add(item);
26
				remote_exit.add(item);
27
			}
27
			}
28
		}
28
		}
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons500
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements26
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)428.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (remoteHosts.length > 0)
    1
    if (remoteHosts.length > 0)
    2
    remote_start = new JMenu(JMeterUtils.getResString("remote_start"));
    2
    remote_start = new JMenu(JMeterUtils.getResString("remote_start"));
    3
    remote_stop = new JMenu(JMeterUtils.getResString("remote_stop"));
    3
    remote_stop = new JMenu(JMeterUtils.getResString("remote_stop"));
    4
    remote_exit = new JMenu(JMeterUtils.getResString("remote_exit"));
    4
    remote_exit = new JMenu(JMeterUtils.getResString("remote_exit"));
    5
    for (int i = 0; i < remoteHosts.length; i++)
    5
    for (int i = 0; i < remoteHosts.length; i++)
    6
    remoteHosts[i] = remoteHosts[i].trim();
    6
    remoteHosts[i] = remoteHosts[i].trim();
    7
    JMenuItem item = new JMenuItem(remoteHosts[i]);
    7
    JMenuItem item = new JMenuItem(remoteHosts[i]);
    8
    item.setActionCommand("remote_start");
    8
    item.setActionCommand("remote_start");
    8
    item.setActionCommand(ActionNames.REMOTE_START);
    Differences
    Expression1Expression2Difference
    "remote_start"ActionNames.REMOTE_STARTTYPE_COMPATIBLE_REPLACEMENT
    8
    item.setActionCommand(ActionNames.REMOTE_START);
    9
    item.setName(remoteHosts[i]);
    15
    item.setName(remoteHosts[i]);
    10
    item.addActionListener(ReportActionRouter.getInstance());
    10
    item.addActionListener(ReportActionRouter.getInstance());
    16
    item.addActionListener(ActionRouter.getInstance());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.report.gui.action.ReportActionRouterorg.apache.jmeter.gui.action.ActionRouterVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.report.gui.action.ReportActionRouterorg.apache.jmeter.gui.action.ActionRouterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance()
    • Make classes org.apache.jmeter.report.gui.action.ReportActionRouter and org.apache.jmeter.gui.action.ActionRouter extend a common superclass
    Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter
    • Make classes org.apache.jmeter.report.gui.action.ReportActionRouter and org.apache.jmeter.gui.action.ActionRouter extend a common superclass
    16
    item.addActionListener(ActionRouter.getInstance());
    11
    remote_engine_start.add(item);
    11
    remote_engine_start.add(item);
    12
    remote_start.add(item);
    12
    remote_start.add(item);
    13
    item = new JMenuItem(remoteHosts[i]);
    20
    item = new JMenuItem(remoteHosts[i]);
    14
    item.setActionCommand("remote_stop");
    14
    item.setActionCommand("remote_stop");
    9
    item.setName(remoteHosts[i]);
    Differences
    Expression1Expression2Difference
    setActionCommandsetNameMETHOD_INVOCATION_NAME_MISMATCH
    "remote_stop"remoteHosts[i]TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression item.setActionCommand("remote_stop") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression item.setName(remoteHosts[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression item.setActionCommand("remote_stop") is a void method call, and thus it cannot be parameterized
    Expression item.setName(remoteHosts[i]) is a void method call, and thus it cannot be parameterized
    Expression remoteHosts[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    item.setName(remoteHosts[i]);
    15
    item.setName(remoteHosts[i]);
    22
    item.setName(remoteHosts[i]);
    16
    item.addActionListener(ReportActionRouter.getInstance());
    16
    item.addActionListener(ReportActionRouter.getInstance());
    23
    item.addActionListener(ActionRouter.getInstance());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.report.gui.action.ReportActionRouterorg.apache.jmeter.gui.action.ActionRouterVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.report.gui.action.ReportActionRouterorg.apache.jmeter.gui.action.ActionRouterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance()
    • Make classes org.apache.jmeter.report.gui.action.ReportActionRouter and org.apache.jmeter.gui.action.ActionRouter extend a common superclass
    Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter
    • Make classes org.apache.jmeter.report.gui.action.ReportActionRouter and org.apache.jmeter.gui.action.ActionRouter extend a common superclass
    23
    item.addActionListener(ActionRouter.getInstance());
    17
    item.setEnabled(false);
    17
    item.setEnabled(false);
    18
    remote_engine_stop.add(item);
    18
    remote_engine_stop.add(item);
    19
    remote_stop.add(item);
    19
    remote_stop.add(item);
    20
    item = new JMenuItem(remoteHosts[i]);
    13
    item = new JMenuItem(remoteHosts[i]);
    21
    item.setActionCommand("remote_exit");
    21
    item.setActionCommand("remote_exit");
    21
    item.setActionCommand(ActionNames.REMOTE_EXIT);
    Differences
    Expression1Expression2Difference
    "remote_exit"ActionNames.REMOTE_EXITTYPE_COMPATIBLE_REPLACEMENT
    21
    item.setActionCommand(ActionNames.REMOTE_EXIT);
    22
    item.setName(remoteHosts[i]);
    22
    item.setName(remoteHosts[i]);
    14
    item.setActionCommand(ActionNames.REMOTE_STOP);
    Differences
    Expression1Expression2Difference
    setNamesetActionCommandMETHOD_INVOCATION_NAME_MISMATCH
    remoteHosts[i]ActionNames.REMOTE_STOPTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression item.setName(remoteHosts[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression item.setActionCommand(ActionNames.REMOTE_STOP) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression item.setName(remoteHosts[i]) is a void method call, and thus it cannot be parameterized
    Expression item.setActionCommand(ActionNames.REMOTE_STOP) is a void method call, and thus it cannot be parameterized
    Expression remoteHosts[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    item.setActionCommand(ActionNames.REMOTE_STOP);
    23
    item.addActionListener(ReportActionRouter.getInstance());
    23
    item.addActionListener(ReportActionRouter.getInstance());
    10
    item.addActionListener(ActionRouter.getInstance());
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.report.gui.action.ReportActionRouterorg.apache.jmeter.gui.action.ActionRouterVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.report.gui.action.ReportActionRouterorg.apache.jmeter.gui.action.ActionRouterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance()
    • Make classes org.apache.jmeter.report.gui.action.ReportActionRouter and org.apache.jmeter.gui.action.ActionRouter extend a common superclass
    Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter
    • Make classes org.apache.jmeter.report.gui.action.ReportActionRouter and org.apache.jmeter.gui.action.ActionRouter extend a common superclass
    10
    item.addActionListener(ActionRouter.getInstance());
    24
    item.setEnabled(false);
    24
    item.setEnabled(false);
    25
    remote_engine_exit.add(item);
    25
    remote_engine_exit.add(item);
    26
    remote_exit.add(item);
    26
    remote_exit.add(item);
    Precondition Violations (22)
    Row Violation
    1Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance()
    4Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter
    5Expression item.setActionCommand("remote_stop") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression item.setName(remoteHosts[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression item.setActionCommand("remote_stop") is a void method call, and thus it cannot be parameterized
    8Expression item.setName(remoteHosts[i]) is a void method call, and thus it cannot be parameterized
    9Expression remoteHosts[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance()
    13Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter
    14Expression item.setName(remoteHosts[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression item.setActionCommand(ActionNames.REMOTE_STOP) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression item.setName(remoteHosts[i]) is a void method call, and thus it cannot be parameterized
    17Expression item.setActionCommand(ActionNames.REMOTE_STOP) is a void method call, and thus it cannot be parameterized
    18Expression remoteHosts[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter.getInstance() does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter.getInstance()
    22Type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter does not match with type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter