for (int i = 0; i < lafs.length; ++i) { JMenuItem laf = new JMenuItem(lafs[i].getName()); laf.addActionListener(ActionRouter.getInstance()); laf.setActionCommand(ActionNames.LAF_PREFIX + lafs[i].getClassName()); lafMenu.setMnemonic('L'); lafMenu.add(laf); }
for (int i = 0; i < lafs.length; ++i) { JMenuItem laf = new JMenuItem(lafs[i].getName()); laf.addActionListener(ReportActionRouter.getInstance()); laf.setActionCommand("laf:" + lafs[i].getClassName()); lafMenu.setMnemonic('L'); lafMenu.add(laf); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/JMeterMenuBar.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuBar.java
Method name: void makeOptionsMenu() Method name: void makeOptionsMenu()
Number of AST nodes: 6 Number of AST nodes: 6
1
for (int i = 0; i < lafs.length; ++i) {
1
for (int i = 0; i < lafs.length; ++i) {
2
			JMenuItem laf = new JMenuItem(lafs[i].getName());
2
			JMenuItem laf = new JMenuItem(lafs[i].getName());
3
			laf.addActionListener(ActionRouter.getInstance());
3
			laf.addActionListener(ReportActionRouter.getInstance());
4
			laf.setActionCommand(ActionNames.LAF_PREFIX + lafs[i].getClassName());
4
			laf.setActionCommand("laf:" + lafs[i].getClassName());
5
			lafMenu.setMnemonic('L');
5
			lafMenu.setMnemonic('L');
6
			lafMenu.add(laf);
6
			lafMenu.add(laf);
7
		}
7
		}
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 in different classes having the same super class
Number of node comparisons36
  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)51.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    for (int i = 0; i < lafs.length; ++i)
    8
    for (int i = 0; i < lafs.length; ++i)
    9
    JMenuItem laf = new JMenuItem(lafs[i].getName());
    9
    JMenuItem laf = new JMenuItem(lafs[i].getName());
    10
    laf.addActionListener(ActionRouter.getInstance());
    10
    laf.addActionListener(ActionRouter.getInstance());
    10
    laf.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
    Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    10
    laf.addActionListener(ReportActionRouter.getInstance());
    11
    laf.setActionCommand(ActionNames.LAF_PREFIX + lafs[i].getClassName());
    11
    laf.setActionCommand(ActionNames.LAF_PREFIX + lafs[i].getClassName());
    11
    laf.setActionCommand("laf:" + lafs[i].getClassName());
    Differences
    Expression1Expression2Difference
    ActionNames.LAF_PREFIX"laf:"TYPE_COMPATIBLE_REPLACEMENT
    11
    laf.setActionCommand("laf:" + lafs[i].getClassName());
    12
    lafMenu.setMnemonic('L');
    12
    lafMenu.setMnemonic('L');
    13
    lafMenu.add(laf);
    13
    lafMenu.add(laf);
    Precondition Violations (4)
    Row Violation
    1Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type 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()
    4Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter