log.debug("popupShouldSave"); 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)); } }
log.debug("popupShouldSave"); if (GuiPackage.getInstance().getTestPlanFile() == null) { if (JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), //$NON-NLS-1$ JMeterUtils.getResString("warning"), //$NON-NLS-1$ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(),ActionNames.SAVE)); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/AbstractAction.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/AbstractAction.java
Method name: void popupShouldSave(ActionEvent) Method name: void popupShouldSave(ActionEvent)
Number of AST nodes: 4 Number of AST nodes: 4
1
log.debug("popupShouldSave");
1
log.debug("popupShouldSave");
2
		if (ReportGuiPackage.getInstance().getReportPlanFile() == null) {
2
		if (GuiPackage.getInstance().getTestPlanFile() == null) {
3
			if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), 
3
			if (JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), 
4
JMeterUtils
4
					JMeterUtils
5
					.getResString("should_save"), 
5
.getResString("should_save"),  //$NON-NLS-1$
6
JMeterUtils.getResString("warning"), 
6
					JMeterUtils.getResString("warning"),  //$NON-NLS-1$
7
JOptionPane.YES_NO_OPTION,
7
					JOptionPane.YES_NO_OPTION,
8
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
8
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
9
				ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE));
9
				ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(),ActionNames.SAVE));
10
			}
10
			}
11
		}
11
		}
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)32.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    log.debug("popupShouldSave");
    1
    log.debug("popupShouldSave");
    2
    if (ReportGuiPackage.getInstance().getReportPlanFile() == null)
    2
    if (ReportGuiPackage.getInstance().getReportPlanFile() == null)
    2
    if (GuiPackage.getInstance().getTestPlanFile() == null)
    Differences
    Expression1Expression2Difference
    getReportPlanFilegetTestPlanFileMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.jmeter.gui.ReportGuiPackageorg.apache.jmeter.gui.GuiPackageSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression ReportGuiPackage cannot be unified with expression GuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public static org.apache.jmeter.gui.GuiPackage getInstance()
    2
    if (GuiPackage.getInstance().getTestPlanFile() == null)
    3
    if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), JMeterUtils.getResString("warning"), 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)
    3
    if (JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.ReportGuiPackageorg.apache.jmeter.gui.GuiPackageSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression ReportGuiPackage cannot be unified with expression GuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public static org.apache.jmeter.gui.GuiPackage getInstance() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame() , public org.apache.jmeter.gui.MainFrame getMainFrame()
    3
    if (JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
    4
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE));
    4
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE));
    4
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.report.gui.action.ReportSaveorg.apache.jmeter.gui.action.ActionNamesVARIABLE_TYPE_MISMATCH
    org.apache.jmeter.report.gui.action.ReportActionRouterorg.apache.jmeter.gui.action.ActionRouterSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.report.gui.action.ReportSave does not match with type org.apache.jmeter.gui.action.ActionNames
    • Make classes org.apache.jmeter.report.gui.action.ReportSave and org.apache.jmeter.gui.action.ActionNames extend a common superclass
    Expression ReportActionRouter cannot be unified with expression ActionRouter , because common superclass java.awt.event.ActionListener does not declare member(s) public static org.apache.jmeter.report.gui.action.ReportActionRouter getInstance() , public static org.apache.jmeter.gui.action.ActionRouter getInstance() , public void doActionNow(java.awt.event.ActionEvent)
    4
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    Precondition Violations (4)
    Row Violation
    1Expression ReportGuiPackage cannot be unified with expression GuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public static org.apache.jmeter.gui.GuiPackage getInstance()
    2Expression ReportGuiPackage cannot be unified with expression GuiPackage , because common superclass org.apache.jmeter.util.LocaleChangeListener does not declare member(s) public static org.apache.jmeter.gui.ReportGuiPackage getInstance() , public static org.apache.jmeter.gui.GuiPackage getInstance() , public org.apache.jmeter.gui.ReportMainFrame getMainFrame() , public org.apache.jmeter.gui.MainFrame getMainFrame()
    3Type org.apache.jmeter.report.gui.action.ReportSave does not match with type org.apache.jmeter.gui.action.ActionNames
    4Expression ReportActionRouter cannot be unified with expression ActionRouter , because common superclass java.awt.event.ActionListener does not declare member(s) public static org.apache.jmeter.report.gui.action.ReportActionRouter getInstance() , public static org.apache.jmeter.gui.action.ActionRouter getInstance() , public void doActionNow(java.awt.event.ActionEvent)