public class EditCommand implements Command { private static final Set commands = new HashSet(); static { commands.add(ActionNames.EDIT); } public EditCommand() { } public void doAction(ActionEvent e) { GuiPackage guiPackage = GuiPackage.getInstance(); guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) guiPackage.getCurrentGui()); guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu()); // TODO: I believe the following code (to the end of the method) is // obsolete, // since NamePanel no longer seems to be the GUI for any component: if (!(guiPackage.getCurrentGui() instanceof NamePanel)) { guiPackage.getMainFrame().setFileLoadEnabled(true); guiPackage.getMainFrame().setFileSaveEnabled(true); } else { guiPackage.getMainFrame().setFileLoadEnabled(false); guiPackage.getMainFrame().setFileSaveEnabled(false); } } public Set getActionNames() { return commands
public class ReportEditCommand implements Command { private static final Set commands = new HashSet(); static { commands.add("edit"); } public ReportEditCommand() { } public void doAction(ActionEvent e) { ReportGuiPackage guiPackage = ReportGuiPackage.getInstance(); guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) guiPackage.getCurrentGui()); guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu()); // TODO: I believe the following code (to the end of the method) is // obsolete, // since NamePanel no longer seems to be the GUI for any component: if (!(guiPackage.getCurrentGui() instanceof NamePanel)) { guiPackage.getMainFrame().setFileLoadEnabled(true); guiPackage.getMainFrame().setFileSaveEnabled(true); } else { guiPackage.getMainFrame().setFileLoadEnabled(false); guiPackage.getMainFrame().setFileSaveEnabled(false); } } public Set getActionNames() { return commands
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/EditCommand.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportEditCommand.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class EditCommand implements Command {
1
public class ReportEditCommand implements Command {
2
	private static final Set commands = new HashSet();
2
	private static final Set commands = new HashSet();
3
	static {
3
	static {
4
		commands.add(ActionNames.EDIT);
4
		commands.add("edit");
5
	}
5
	}
6
	public EditCommand() {
6
	public ReportEditCommand() {
7
	}
7
	}
8
	public void doAction(ActionEvent e) {
8
	public void doAction(ActionEvent e) {
9
		GuiPackage guiPackage = GuiPackage.getInstance();
9
		ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
10
		guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) guiPackage.getCurrentGui());
10
		guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) guiPackage.getCurrentGui());
11
		guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu());
11
		guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu());
12
		// TODO: I believe the following code (to the end of the method) is
12
		// TODO: I believe the following code (to the end of the method) is
13
		// obsolete,
13
		// obsolete,
14
		// since NamePanel no longer seems to be the GUI for any component:
14
		// since NamePanel no longer seems to be the GUI for any component:
15
		if (!(guiPackage.getCurrentGui() instanceof NamePanel)) {
15
		if (!(guiPackage.getCurrentGui() instanceof NamePanel)) {
16
			guiPackage.getMainFrame().setFileLoadEnabled(true);
16
			guiPackage.getMainFrame().setFileLoadEnabled(true);
17
			guiPackage.getMainFrame().setFileSaveEnabled(true);
17
			guiPackage.getMainFrame().setFileSaveEnabled(true);
18
		} else {
18
		} else {
19
			guiPackage.getMainFrame().setFileLoadEnabled(false);
19
			guiPackage.getMainFrame().setFileLoadEnabled(false);
20
			guiPackage.getMainFrame().setFileSaveEnabled(false);
20
			guiPackage.getMainFrame().setFileSaveEnabled(false);
21
		}
21
		}
22
	}
22
	}
23
	public Set getActionNames() {
23
	public Set getActionNames() {
24
		return commands
24
		return commands
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