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 (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)); } }
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/ReportClose.java
Method name: void popupShouldSave(ActionEvent) Method name: void doAction(ActionEvent)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (GuiPackage.getInstance().getTestPlanFile() == null) {
1
if (guiPackage.isDirty()) {
2
			if (JOptionPane.showConfirmDialog(GuiPackage.getInstance()
2
			if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance()
3
.getMainFrame(), 
3
					.getMainFrame(), 
4
					JMeterUtils
4
JMeterUtils
5
.getResString("should_save"),  //$NON-NLS-1$
5
					.getResString("
6
					JMeterUtils
6
cancel_new_to_save"), JMeterUtils
7
.getResString("warning"),  //$NON-NLS-1$
7
					.getResString("
8
					JOptionPane.YES_NO_OPTION,
8
Save?"), JOptionPane.YES_NO_OPTION,
9
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
9
					JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
10
				ActionRouter.getInstance().doActionNow(
10
				ReportActionRouter.getInstance().doActionNow(
11
new ActionEvent(e.getSource(), e.getID(),ActionNames.SAVE));
11
						new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
12
			}
12
			}
13
		}
13
		}
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.0
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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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)
    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)
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.GuiPackageorg.apache.jmeter.gui.ReportGuiPackageSUBCLASS_TYPE_MISMATCH
    "should_save""cancel_new_to_save"LITERAL_VALUE_MISMATCH
    "warning""Save?"LITERAL_VALUE_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()
    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
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    4
    ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    5
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.gui.action.ActionRouterorg.apache.jmeter.report.gui.action.ReportActionRouterSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    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)
    5
    ReportActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
    Precondition Violations (2)
    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 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)