Bug 70292 - [1.5] enum makes Copy, Cut commands fail
Summary: [1.5] enum makes Copy, Cut commands fail
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-17 18:00 EDT by Aaron Stewart CLA
Modified: 2006-04-14 09:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Stewart CLA 2004-07-17 18:00:55 EDT
Create a new file named Bar.java in package foo.

type (or paste) in file:
<SNIP>
package foo;

public enum Bar {ONE, TWO, THREE; }
</SNIP>

attempting to use Copy, or Cut commands subsequently (menu or shortcut) in the
file will fail.

This is using Eclipse SDK 3.0 with the "Cheetah" update for 1.5 compatability.
Comment 1 Rafael Chaves CLA 2004-07-19 12:26:44 EDT
Any entries in your log when you do that?

Moving to JDT/Text.
Comment 2 Dani Megert CLA 2004-07-19 12:50:30 EDT
How did you update to Cheetah?
Is the command disabled?
Comment 3 Dani Megert CLA 2004-07-20 02:40:26 EDT
From Aaron's e-mail:

I updated to Cheetah by letting eclipse grab the plug-in from:

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-core-home/update-site

The commands were not visibly disabled in the menu; just reported as
failing after attempting them.
Comment 4 Dani Megert CLA 2004-07-20 02:41:48 EDT
>just reported as failing after attempting them.
How? You did not mention this when filing the bug.
Any entries in .log?
Comment 5 Aaron Stewart CLA 2004-07-20 12:01:29 EDT
(Sorry I would have posted this earlier, I didn't know that eclipse had such a
well consealed error log ;p )

Here is the entry each time I do it:

!ENTRY org.eclipse.ui 4 4 Jul 20, 2004 11:49:42.863
!MESSAGE The command for the key you pressed failed

!ENTRY org.eclipse.ui 4 0 Jul 20, 2004 11:49:42.893
!MESSAGE The command for the key you pressed failed
!STACK 0
java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2587)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1411)
	at
org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:311)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1448)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2462)
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1271)
	at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:710)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:681)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
	at
org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:441)
	at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:393)
	at
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.getClipboardData(ClipboardOperationAction.java:363)
	at
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.doCutCopyWithImportsOperation(ClipboardOperationAction.java:300)
	at
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.internalDoOperation(ClipboardOperationAction.java:256)
	at
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction$1.run(ClipboardOperationAction.java:225)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at
org.eclipse.jdt.internal.ui.javaeditor.ClipboardOperationAction.run(ClipboardOperationAction.java:223)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:141)
	at org.eclipse.ui.internal.commands.Command.execute(Command.java:132)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:471)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:889)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:930)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:548)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:496)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:261)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:740)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:795)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:820)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:805)
	at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1734)
	at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1730)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3067)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:2970)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3338)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1467)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2429)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
	at org.eclipse.core.launcher.Main.run(Main.java:644)
	at org.eclipse.core.launcher.Main.main(Main.java:628)
Comment 6 Olivier Thomann CLA 2004-07-26 17:26:42 EDT
Cannot reproduce with latest HEAD contents.
Comment 7 Olivier Thomann CLA 2004-08-09 11:54:37 EDT
Fixed and released in HEAD.
Regression test added.
Comment 8 Frederic Fusier CLA 2006-04-14 09:55:48 EDT
Verified for 3.1 using build I20050627-1435.