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)); } }
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/gui/action/AbstractAction.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/AbstractAction.java
Method name: void popupShouldSave(ActionEvent) Method name: void popupShouldSave(ActionEvent)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (GuiPackage.getInstance().getTestPlanFile() == null) {
1
if (ReportGuiPackage.getInstance().getReportPlanFile() == null) {
2
			if (JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), 
2
			if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), 
3
					JMeterUtils
3
JMeterUtils
4
.getResString("should_save"),  //$NON-NLS-1$
4
					.getResString("should_save"), 
5
					JMeterUtils.getResString("warning"),  //$NON-NLS-1$
5
JMeterUtils.getResString("warning"), 
6
					JOptionPane.YES_NO_OPTION,
6
JOptionPane.YES_NO_OPTION,
7
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
7
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
8
				ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(),ActionNames.SAVE));
8
				ReportActionRouter.getInstance().doActionNow(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)1.1
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)30.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (GuiPackage.getInstance().getTestPlanFile() == null)
    2
    if (GuiPackage.getInstance().getTestPlanFile() == null)
    2
    if (ReportGuiPackage.getInstance().getReportPlanFile() == null)
    Differences
    Expression1Expression2Difference
    getTestPlanFilegetReportPlanFileMETHOD_INVOCATION_NAME_MISMATCH
    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()
    2
    if (ReportGuiPackage.getInstance().getReportPlanFile() == null)
    3
    if (JOptionPane.showConfirmDialog(GuiPackage.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)
    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
    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()
    3
    if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("should_save"), JMeterUtils.getResString("warning"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
    4
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    4
    ActionRouter.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
    org.apache.jmeter.gui.action.ActionRouterorg.apache.jmeter.report.gui.action.ReportActionRouterSUBCLASS_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
    Expression ActionRouter cannot be unified with expression ReportActionRouter , because common superclass java.awt.event.ActionListener does not declare member(s) public static org.apache.jmeter.gui.action.ActionRouter getInstance() , public static org.apache.jmeter.report.gui.action.ReportActionRouter getInstance() , public void doActionNow(java.awt.event.ActionEvent)
    4
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ReportSave.SAVE));
    Precondition Violations (4)
    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()
    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()
    3Type org.apache.jmeter.gui.action.ActionNames does not match with type org.apache.jmeter.report.gui.action.ReportSave
    4Expression ActionRouter cannot be unified with expression ReportActionRouter , because common superclass java.awt.event.ActionListener does not declare member(s) public static org.apache.jmeter.gui.action.ActionRouter getInstance() , public static org.apache.jmeter.report.gui.action.ReportActionRouter getInstance() , public void doActionNow(java.awt.event.ActionEvent)