void closeMenu() { if (menuBar.isSelected()) { MenuElement[] menuElement = menuBar.getSubElements(); if (menuElement != null) { for (int i = 0; i < menuElement.length; i++) { JMenu menu = (JMenu) menuElement[i]; if (menu.isSelected()) { menu.setPopupMenuVisible(false); menu.setSelected(false); break; } } } } } /** * Show a dialog indicating that JMeter threads are stopping on a particular * host. * * @param host * the host where JMeter threads are stopping */ public void showStoppingMessage(String host) { stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true); //$NON-NLS-1$ JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host); //$NON-NLS-1$$NON-NLS-2$ stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); stoppingMessage.getContentPane().add(stopLabel); stoppingMessage.pack(); ComponentUtil.centerComponentInComponent(this, stoppingMessage); SwingUtilities.invokeLater(new Runnable() { public void run() { if (stoppingMessage != null) {// TODO - how can this be null? stoppingMessage.show(); } } }); }
void closeMenu() { if (menuBar.isSelected()) { MenuElement[] menuElement = menuBar.getSubElements(); if (menuElement != null) { for (int i = 0; i < menuElement.length; i++) { JMenu menu = (JMenu) menuElement[i]; if (menu.isSelected()) { menu.setPopupMenuVisible(false); menu.setSelected(false); break; } } } } } /** * Show a dialog indicating that JMeter threads are stopping on a particular * host. * * @param host * the host where JMeter threads are stopping */ public void showStoppingMessage(String host) { stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true);// $NON-NLS-1$ JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host);// $NON-NLS-1$ stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); stoppingMessage.getContentPane().add(stopLabel); stoppingMessage.pack(); ComponentUtil.centerComponentInComponent(this, stoppingMessage); SwingUtilities.invokeLater(new Runnable() { public void run() { if (stoppingMessage != null) { stoppingMessage.show(); } } }); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/MainFrame.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/ReportMainFrame.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void closeMenu() {
1
void closeMenu() {
2
		if (menuBar.isSelected()) {
2
        if (menuBar.isSelected()) {
3
			MenuElement[] menuElement = menuBar.getSubElements();
3
            MenuElement[] menuElement = menuBar.getSubElements();
4
			if (menuElement != null) {
4
            if (menuElement != null) {
5
				for (int i = 0; i < menuElement.length; i++) {
5
                for (int i = 0; i < menuElement.length; i++) {
6
					JMenu menu = (JMenu) menuElement[i];
6
                    JMenu menu = (JMenu) menuElement[i];
7
					if (menu.isSelected()) {
7
                    if (menu.isSelected()) {
8
						menu.setPopupMenuVisible(false);
8
                        menu.setPopupMenuVisible(false);
9
						menu.setSelected(false);
9
                        menu.setSelected(false);
10
						break;
11
					}
12
				}
13
			}
14
		}
15
	}
16
	
10
                        break;
11
                    }
12
                }
13
            }
14
        }
15
    }
17
/**
16
    /**
18
	 * Show a dialog indicating that JMeter threads are stopping on a particular
17
     * Show a dialog indicating that JMeter threads are stopping on a particular
19
	 * host.
18
     * host.
20
	 * 
19
     * 
21
	 * @param host
20
     * @param host
22
	 *            the host where JMeter threads are stopping
21
     *            the host where JMeter threads are stopping
23
	 */
22
     */
24
	public void showStoppingMessage(String host) {
23
    public void showStoppingMessage(String host) {
25
		stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true); //$NON-NLS-1$
24
        stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true);// $NON-NLS-1$
26
		JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host); //$NON-NLS-1$$NON-NLS-2$
25
        JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host);// $NON-NLS-1$
27
		
28
stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
26
        stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
29
		stoppingMessage.getContentPane().add(stopLabel);
27
        stoppingMessage.getContentPane().add(stopLabel);
30
		stoppingMessage.pack();
28
        stoppingMessage.pack();
31
		ComponentUtil.centerComponentInComponent(this, stoppingMessage);
29
        ComponentUtil.centerComponentInComponent(this, stoppingMessage);
32
		SwingUtilities.invokeLater(new Runnable() {
30
        SwingUtilities.invokeLater(new Runnable() {
33
			public void run() {
31
            public void run() {
34
				if (stoppingMessage != null) {// TODO - how can this be null?
32
                if (stoppingMessage != null) {
35
					stoppingMessage.show();
36
				}
37
			}
38
		
33
                    stoppingMessage.show();
34
                }
35
            }
39
});
36
        });
40
	}
37
    }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0