edit_remove.setEnabled(enabled); // If we are enabling the Edit-->Remove 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-->Remove menu item and the // Edit-->Add 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_add.isEnabled()) { editMenu.setEnabled(false); } }
edit_remove.setEnabled(enabled); // If we are enabling the Edit-->Remove 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-->Remove menu item and the // Edit-->Add 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_add.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 setEditRemoveEnabled(boolean) Method name: void setEditRemoveEnabled(boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
edit_remove.setEnabled(enabled);
1
edit_remove.setEnabled(enabled);
2
		// If we are enabling the Edit-->Remove menu item, then we also need to
2
		// If we are enabling the Edit-->Remove menu item, then we also need to
3
		// enable the Edit menu. The Edit menu may already be enabled, but
3
		// enable the Edit menu. The Edit menu may already be enabled, but
4
		// there's no harm it trying to enable it again.
4
		// there's no harm it trying to enable it again.
5
		if (enabled) {
5
		if (enabled) {
6
			setEditEnabled(true);
6
			setEditEnabled(true);
7
		} else {
7
		} else {
8
			// If we are disabling the Edit-->Remove menu item and the
8
			// If we are disabling the Edit-->Remove menu item and the
9
			// Edit-->Add menu item is disabled, then we also need to disable
9
			// Edit-->Add menu item is disabled, then we also need to disable
10
			// the Edit menu.
10
			// the Edit menu.
11
			// The Java Look and Feel Guidelines say to disable a menu if all
11
			// The Java Look and Feel Guidelines say to disable a menu if all
12
			// menu items are disabled.
12
			// menu items are disabled.
13
			if (!edit_add.isEnabled()) {
13
			if (!edit_add.isEnabled()) {
14
				editMenu.setEnabled(false);
14
				editMenu.setEnabled(false);
15
			}
15
			}
16
		}
16
		}
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    edit_remove.setEnabled(enabled);
    1
    edit_remove.setEnabled(enabled);
    2
    if (enabled)
    2
    if (enabled)
    3
    setEditEnabled(true);
    3
    setEditEnabled(true);
    else
    else
    4
    if (!edit_add.isEnabled())
    4
    if (!edit_add.isEnabled())
    5
    editMenu.setEnabled(false);
    5
    editMenu.setEnabled(false);
    Precondition Violations (0)
    Row Violation