public void setEditAddEnabled(boolean enabled) { // There was a NPE being thrown without the null check here.. JKB if (edit_add != null) { edit_add.setEnabled(enabled); } // If we are enabling the Edit-->Add menu item, then we also need to // enable the Edit menu. The Edit menu may already be enabled, but // there's no harm it trying to enable it again. if (enabled) { setEditEnabled(true); } else { // If we are disabling the Edit-->Add menu item and the // Edit-->Remove menu item is disabled, then we also need to // disable the Edit menu. // The Java Look and Feel Guidelines say to disable a menu if all // menu items are disabled. if (!edit_remove.isEnabled()) { editMenu.setEnabled(false);
public void setEditAddEnabled(boolean enabled) { // There was a NPE being thrown without the null check here.. JKB if (edit_add != null) { edit_add.setEnabled(enabled); } // If we are enabling the Edit-->Add menu item, then we also need to // enable the Edit menu. The Edit menu may already be enabled, but // there's no harm it trying to enable it again. if (enabled) { setEditEnabled(true); } else { // If we are disabling the Edit-->Add menu item and the // Edit-->Remove menu item is disabled, then we also need to // disable the Edit menu. // The Java Look and Feel Guidelines say to disable a menu if all // menu items are disabled. if (!edit_remove.isEnabled()) { editMenu.setEnabled(false);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/JMeterMenuBar.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/ReportMenuBar.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void setEditAddEnabled(boolean enabled) {
1
public void setEditAddEnabled(boolean enabled) {
2
		// There was a NPE being thrown without the null check here.. JKB
2
		// There was a NPE being thrown without the null check here.. JKB
3
		if (edit_add != null) {
3
		if (edit_add != null) {
4
			edit_add.setEnabled(enabled);
4
			edit_add.setEnabled(enabled);
5
		}
5
		}
6
		// If we are enabling the Edit-->Add menu item, then we also need to
6
		// If we are enabling the Edit-->Add menu item, then we also need to
7
		// enable the Edit menu. The Edit menu may already be enabled, but
7
		// enable the Edit menu. The Edit menu may already be enabled, but
8
		// there's no harm it trying to enable it again.
8
		// there's no harm it trying to enable it again.
9
		if (enabled) {
9
		if (enabled) {
10
			setEditEnabled(true);
10
			setEditEnabled(true);
11
		} else {
11
		} else {
12
			// If we are disabling the Edit-->Add menu item and the
12
			// If we are disabling the Edit-->Add menu item and the
13
			// Edit-->Remove menu item is disabled, then we also need to
13
			// Edit-->Remove menu item is disabled, then we also need to
14
			// disable the Edit menu.
14
			// disable the Edit menu.
15
			// The Java Look and Feel Guidelines say to disable a menu if all
15
			// The Java Look and Feel Guidelines say to disable a menu if all
16
			// menu items are disabled.
16
			// menu items are disabled.
17
			if (!edit_remove.isEnabled()) {
17
			if (!edit_remove.isEnabled()) {
18
				editMenu.setEnabled(false);
18
				editMenu.setEnabled(false);
19
			
19
			
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