if (guiPackage.isDirty()) { if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance() .getMainFrame(), JMeterUtils .getResString("cancel_new_to_save"), JMeterUtils .getResString("Save?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { ReportActionRouter.getInstance().doActionNow( new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE)); } }
if (ReportGuiPackage.getInstance().getReportPlanFile() == null) { if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils .getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE)); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportClose.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/AbstractAction.java
Method name: void doAction(ActionEvent) Method name: void popupShouldSave(ActionEvent)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (guiPackage.isDirty()) {
1
if (ReportGuiPackage.getInstance().getReportPlanFile() == null) {
2
			if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance()
2
			if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance()
3
					.getMainFrame(), JMeterUtils
3
.getMainFrame(), JMeterUtils
4
					.getResString("cancel_new_to_save"), JMeterUtils
4
					.getResString("should_save"), JMeterUtils
5
					.getResString("Save?"), JOptionPane.YES_NO_OPTION,
5
.getResString("warning"), JOptionPane.YES_NO_OPTION,
6
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
6
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
7
				ReportActionRouter.getInstance().doActionNow(
7
				ReportActionRouter.getInstance().doActionNow(
8
						new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
8
new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE));
9
			}
9
			}
10
		}
10
		}
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.5
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("cancel_new_to_save"), JMeterUtils.getResString("Save?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
    4
    if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("cancel_new_to_save"), JMeterUtils.getResString("Save?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
    3
    if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
    Differences
    Expression1Expression2Difference
    "cancel_new_to_save""should_save"LITERAL_VALUE_MISMATCH
    "Save?""warning"LITERAL_VALUE_MISMATCH
    3
    if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
    5
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    5
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    4
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE));
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.action.ActionNamesorg.apache.jmeter.report.gui.action.ReportSaveVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.gui.action.ActionNames does not match with type org.apache.jmeter.report.gui.action.ReportSave
    • Make classes org.apache.jmeter.gui.action.ActionNames and org.apache.jmeter.report.gui.action.ReportSave extend a common superclass
    4
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE));
    Precondition Violations (1)
    Row Violation
    1Type org.apache.jmeter.gui.action.ActionNames does not match with type org.apache.jmeter.report.gui.action.ReportSave