if (e.getActionCommand().equals(ActionNames.ACTION_START)) { popupShouldSave(e); startEngine(); } else if (e.getActionCommand().equals(ActionNames.ACTION_STOP)) { if (engine != null) { GuiPackage.getInstance().getMainFrame().showStoppingMessage(""); engine.stopTest(); engine = null; } } else if (e.getActionCommand().equals(ActionNames.ACTION_SHUTDOWN)) { if (engine != null) { GuiPackage.getInstance().getMainFrame().showStoppingMessage(""); engine.askThreadsToStop(); engine = null; } }
if (e.getActionCommand().equals(ActionNames.ACTION_START)) { popupShouldSave(e); startEngine(); } else if (e.getActionCommand().equals(ActionNames.ACTION_STOP)) { if (engine != null) { ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage(""); engine.stopTest(); engine = null; } } else if (e.getActionCommand().equals(ActionNames.ACTION_SHUTDOWN)) { if (engine != null) { ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage(""); engine.askThreadsToStop(); engine = null; } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/Start.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportStart.java
Method name: void doAction(ActionEvent) Method name: void doAction(ActionEvent)
Number of AST nodes: 13 Number of AST nodes: 13
1
if (e.getActionCommand().equals(ActionNames.ACTION_START)) {
1
if (e.getActionCommand().equals(ActionNames.ACTION_START)) {
2
			popupShouldSave(e);
2
			popupShouldSave(e);
3
			startEngine();
3
			startEngine();
4
		} else if (e.getActionCommand().equals(ActionNames.ACTION_STOP)) {
4
		} else if (e.getActionCommand().equals(ActionNames.ACTION_STOP)) {
5
			if (engine != null) {
5
			if (engine != null) {
6
				GuiPackage.getInstance().getMainFrame().showStoppingMessage("");
6
				ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage("");
7
				engine.stopTest();
7
				engine.stopTest();
8
				engine = null;
8
				engine = null;
9
			}
9
			}
10
		} else if (e.getActionCommand().equals(ActionNames.ACTION_SHUTDOWN)) {
10
		} else if (e.getActionCommand().equals(ActionNames.ACTION_SHUTDOWN)) {
11
			if (engine != null) {
11
			if (engine != null) {
12
				GuiPackage.getInstance().getMainFrame().showStoppingMessage("");
12
				ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage("");
13
				engine.askThreadsToStop();
13
				engine.askThreadsToStop();
14
				engine = null;
14
				engine = null;
15
			}
15
			}
16
		}
16
		}
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)1.3
Clones locationClones are in different classes
Number of node comparisons65
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)81.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (e.getActionCommand().equals(ActionNames.ACTION_START))
    1
    if (e.getActionCommand().equals(ActionNames.ACTION_START))
    2
    popupShouldSave(e);
    2
    popupShouldSave(e);
    3
    startEngine();
    3
    startEngine();
    4
    else if (e.getActionCommand().equals(ActionNames.ACTION_STOP))
    4
    else if (e.getActionCommand().equals(ActionNames.ACTION_STOP))
    5
    if (engine != null)
    5
    if (engine != null)
    6
    GuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    6
    GuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    6
    ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.GuiPackageorg.apache.jmeter.gui.ReportGuiPackageSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression GuiPackage cannot be unified with expression ReportGuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.GuiPackage getInstance() , public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public org.apache.jmeter.gui.MainFrame getMainFrame() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame()
    6
    ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    7
    engine.stopTest();
    7
    engine.stopTest();
    8
    engine = null;
    8
    engine = null;
    9
    else if (e.getActionCommand().equals(ActionNames.ACTION_SHUTDOWN))
    9
    else if (e.getActionCommand().equals(ActionNames.ACTION_SHUTDOWN))
    10
    if (engine != null)
    10
    if (engine != null)
    11
    GuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    11
    GuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    11
    ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.GuiPackageorg.apache.jmeter.gui.ReportGuiPackageSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression GuiPackage cannot be unified with expression ReportGuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.GuiPackage getInstance() , public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public org.apache.jmeter.gui.MainFrame getMainFrame() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame()
    11
    ReportGuiPackage.getInstance().getMainFrame().showStoppingMessage("");
    12
    engine.askThreadsToStop();
    12
    engine.askThreadsToStop();
    13
    engine = null;
    13
    engine = null;
    Precondition Violations (3)
    Row Violation
    1Expression GuiPackage cannot be unified with expression ReportGuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.GuiPackage getInstance() , public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public org.apache.jmeter.gui.MainFrame getMainFrame() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame()
    2Expression GuiPackage cannot be unified with expression ReportGuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.GuiPackage getInstance() , public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public org.apache.jmeter.gui.MainFrame getMainFrame() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame()
    3The refactoring of the clones is infeasible, because classes org.apache.jmeter.gui.action.Start and org.apache.jmeter.report.gui.action.ReportStart do not have a common superclass