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); } }
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: void setEditAddEnabled(boolean) Method name: void setEditAddEnabled(boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (edit_add != null) {
1
if (edit_add != null) {
2
			edit_add.setEnabled(enabled);
2
			edit_add.setEnabled(enabled);
3
		}
3
		}
4
		// If we are enabling the Edit-->Add menu item, then we also need to
4
		// If we are enabling the Edit-->Add menu item, then we also need to
5
		// enable the Edit menu. The Edit menu may already be enabled, but
5
		// enable the Edit menu. The Edit menu may already be enabled, but
6
		// there's no harm it trying to enable it again.
6
		// there's no harm it trying to enable it again.
7
		if (enabled) {
7
		if (enabled) {
8
			setEditEnabled(true);
8
			setEditEnabled(true);
9
		} else {
9
		} else {
10
			// If we are disabling the Edit-->Add menu item and the
10
			// If we are disabling the Edit-->Add menu item and the
11
			// Edit-->Remove menu item is disabled, then we also need to
11
			// Edit-->Remove menu item is disabled, then we also need to
12
			// disable the Edit menu.
12
			// disable the Edit menu.
13
			// The Java Look and Feel Guidelines say to disable a menu if all
13
			// The Java Look and Feel Guidelines say to disable a menu if all
14
			// menu items are disabled.
14
			// menu items are disabled.
15
			if (!edit_remove.isEnabled()) {
15
			if (!edit_remove.isEnabled()) {
16
				editMenu.setEnabled(false);
16
				editMenu.setEnabled(false);
17
			}
17
			}
18
		}
18
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes having the same super class
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    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.4
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (edit_add != null)
    1
    if (edit_add != null)
    2
    edit_add.setEnabled(enabled);
    2
    edit_add.setEnabled(enabled);
    3
    if (enabled)
    3
    if (enabled)
    4
    setEditEnabled(true);
    4
    setEditEnabled(true);
    else
    else
    5
    if (!edit_remove.isEnabled())
    5
    if (!edit_remove.isEnabled())
    6
    editMenu.setEnabled(false);
    6
    editMenu.setEnabled(false);
    Precondition Violations (0)
    Row Violation