ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY)); if (GuiPackage.getInstance().isDirty()) { int chosenOption = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils .getResString("cancel_exit_to_save"), // $NON-NLS-1$ JMeterUtils.getResString("save?"), // $NON-NLS-1$ JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (chosenOption == JOptionPane.NO_OPTION) { System.exit(0); } else if (chosenOption == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE_ALL_AS)); if (!GuiPackage.getInstance().isDirty()) { System.exit(0); } } } else { System.exit(0); }
ReportActionRouter.getInstance().doActionNow( new ActionEvent(e.getSource(), e.getID(), ReportCheckDirty.CHECK_DIRTY)); if (ReportGuiPackage.getInstance().isDirty()) { int chosenOption = JOptionPane.showConfirmDialog(ReportGuiPackage .getInstance().getMainFrame(), JMeterUtils .getResString("cancel_exit_to_save"), JMeterUtils .getResString("Save?"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (chosenOption == JOptionPane.NO_OPTION) { System.exit(0); } else if (chosenOption == JOptionPane.YES_OPTION) { ReportActionRouter.getInstance().doActionNow( new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE_ALL_AS)); if (!ReportGuiPackage.getInstance().isDirty()) { System.exit(0); } } } else { System.exit(0); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/ExitCommand.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportExitCommand.java
Method name: void doAction(ActionEvent) Method name: void doAction(ActionEvent)
Number of AST nodes: 10 Number of AST nodes: 10
1
ActionRouter.getInstance().doActionNow(
1
ReportActionRouter.getInstance().doActionNow(
2
new ActionEvent(e.getSource(), e.getID(), ActionNames
2
				new ActionEvent(e.getSource(), e.getID(),
3
.CHECK_DIRTY));
3
						ReportCheckDirty.CHECK_DIRTY));
4
		if (GuiPackage.getInstance().isDirty()) {
4
		if (ReportGuiPackage.getInstance().isDirty()) {
5
			int chosenOption = JOptionPane.showConfirmDialog(GuiPackage
5
			int chosenOption = JOptionPane.showConfirmDialog(ReportGuiPackage
6
.getInstance().getMainFrame(), JMeterUtils
6
					.getInstance().getMainFrame(), JMeterUtils
7
					.getResString("cancel_exit_to_save"), // $NON-NLS-1$
7
					.getResString("cancel_exit_to_save"), 
8
					JMeterUtils
8
JMeterUtils
9
.getResString("save?"), // $NON-NLS-1$
9
					.getResString("Save?"), 
10
					JOptionPane.YES_NO_CANCEL_OPTION, 
10
JOptionPane.YES_NO_CANCEL_OPTION,
11
JOptionPane.QUESTION_MESSAGE);
11
					JOptionPane.QUESTION_MESSAGE);
12
			if (chosenOption == JOptionPane.NO_OPTION) {
12
			if (chosenOption == JOptionPane.NO_OPTION) {
13
				System.exit(0);
13
				System.exit(0);
14
			} else if (chosenOption == JOptionPane.YES_OPTION) {
14
			} else if (chosenOption == JOptionPane.YES_OPTION) {
15
				ActionRouter.getInstance().doActionNow(
15
				ReportActionRouter.getInstance().doActionNow(
16
new ActionEvent(e.getSource(), e.getID(), ActionNames
16
						new ActionEvent(e.getSource(), e.getID(),
17
.SAVE_ALL_AS));
17
								ReportSave.SAVE_ALL_AS));
18
				if (!GuiPackage.getInstance().isDirty()) {
18
				if (!ReportGuiPackage.getInstance().isDirty()) {
19
					System.exit(0);
19
					System.exit(0);
20
				}
20
				}
21
			}
21
			}
22
		} else {
22
		} else {
23
			System.exit(0);
23
			System.exit(0);
24
		}
24
		}
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.7
Clones locationClones are in different classes
Number of node comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY));
    1
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.CHECK_DIRTY));
    1
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportCheckDirty.CHECK_DIRTY));
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.action.ActionNamesorg.apache.jmeter.report.gui.action.ReportCheckDirtyVARIABLE_TYPE_MISMATCH
    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.ActionNames of variable ActionNames does not match with type org.apache.jmeter.report.gui.action.ReportCheckDirty of variable ReportCheckDirty
    • Make classes org.apache.jmeter.gui.action.ActionNames and org.apache.jmeter.report.gui.action.ReportCheckDirty extend a common superclass
    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
    1
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportCheckDirty.CHECK_DIRTY));
    2
    if (GuiPackage.getInstance().isDirty())
    2
    if (GuiPackage.getInstance().isDirty())
    2
    if (ReportGuiPackage.getInstance().isDirty())
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.GuiPackageorg.apache.jmeter.gui.ReportGuiPackageVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.gui.GuiPackageorg.apache.jmeter.gui.ReportGuiPackageVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage.getInstance() does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage.getInstance()
    • Make classes org.apache.jmeter.gui.GuiPackage and org.apache.jmeter.gui.ReportGuiPackage extend a common superclass
    Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage
    • Make classes org.apache.jmeter.gui.GuiPackage and org.apache.jmeter.gui.ReportGuiPackage extend a common superclass
    2
    if (ReportGuiPackage.getInstance().isDirty())
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    3
    int chosenOption = JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("cancel_exit_to_save"), JMeterUtils.getResString("Save?"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
    3
    int chosenOption = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("cancel_exit_to_save"), JMeterUtils.getResString("save?"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    4
    if (chosenOption == JOptionPane.NO_OPTION)
    4
    if (chosenOption == JOptionPane.NO_OPTION)
    5
    System.exit(0);
    5
    System.exit(0);
    6
    else if (chosenOption == JOptionPane.YES_OPTION)
    6
    else if (chosenOption == JOptionPane.YES_OPTION)
    7
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE_ALL_AS));
    7
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE_ALL_AS));
    7
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE_ALL_AS));
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.action.ActionNamesorg.apache.jmeter.report.gui.action.ReportSaveVARIABLE_TYPE_MISMATCH
    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.ActionNames of variable ActionNames does not match with type org.apache.jmeter.report.gui.action.ReportSave of variable ReportSave
    • Make classes org.apache.jmeter.gui.action.ActionNames and org.apache.jmeter.report.gui.action.ReportSave extend a common superclass
    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
    7
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE_ALL_AS));
    8
    if (!GuiPackage.getInstance().isDirty())
    8
    if (!GuiPackage.getInstance().isDirty())
    8
    if (!ReportGuiPackage.getInstance().isDirty())
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.GuiPackageorg.apache.jmeter.gui.ReportGuiPackageVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.gui.GuiPackageorg.apache.jmeter.gui.ReportGuiPackageVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage.getInstance() does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage.getInstance()
    • Make classes org.apache.jmeter.gui.GuiPackage and org.apache.jmeter.gui.ReportGuiPackage extend a common superclass
    Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage
    • Make classes org.apache.jmeter.gui.GuiPackage and org.apache.jmeter.gui.ReportGuiPackage extend a common superclass
    8
    if (!ReportGuiPackage.getInstance().isDirty())
    9
    System.exit(0);
    9
    System.exit(0);
    else
    else
    10
    System.exit(0);
    10
    System.exit(0);
    Precondition Violations (12)
    Row Violation
    1Type org.apache.jmeter.gui.action.ActionNames of variable ActionNames does not match with type org.apache.jmeter.report.gui.action.ReportCheckDirty of variable ReportCheckDirty
    2Type 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()
    3Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter
    4Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage.getInstance() does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage.getInstance()
    5Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage
    6Type org.apache.jmeter.gui.action.ActionNames of variable ActionNames does not match with type org.apache.jmeter.report.gui.action.ReportSave of variable ReportSave
    7Expression ActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression ReportActionRouter.getInstance() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Type 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()
    10Type org.apache.jmeter.gui.action.ActionRouter of variable ActionRouter does not match with type org.apache.jmeter.report.gui.action.ReportActionRouter of variable ReportActionRouter
    11Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage.getInstance() does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage.getInstance()
    12Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage