on 01-30-2008 4:04 PM
Hi,
using NWDS 7.1.1, when I open a java file with this content:
package test;
public enum TestEnum {
}
The editor fails to open with an exception as shown below. It appears some SAP code expects something else than EnumDeclaration in AnnotationImpl. I can work around this, using a simple text editor, I just wanted to mention it.
java.lang.ClassCastException: org.eclipse.jdt.core.dom.EnumDeclaration
at com.sap.ide.j2ee.servicelayer.annotation.impl.AnnotationImpl.getTypeDeclaration(AnnotationImpl.java:527)
at com.sap.ide.j2ee.servicelayer.annotation.impl.AnnotationImpl.getFromMember(AnnotationImpl.java:342)
at com.sap.ide.j2ee.servicelayer.annotation.impl.AnnotationImpl.getFromClass(AnnotationImpl.java:319)
at com.sap.ide.j2ee.servicelayer.annotation.factory.AnnotationUtils.getAnnotationsFromClass(AnnotationUtils.java:28)
at com.sap.ide.j2ee.ui.actions.MethodMenuActionsHandler.isSessionBean(MethodMenuActionsHandler.java:229)
at com.sap.ide.j2ee.ui.actions.editor.GeneralEditorAction.isEnabled(GeneralEditorAction.java:98)
at com.sap.ide.j2ee.ui.actions.editor.GeneralEditorAction.setActiveEditor(GeneralEditorAction.java:59)
at org.eclipse.ui.internal.EditorPluginAction.editorChanged(EditorPluginAction.java:75)
at org.eclipse.ui.internal.EditorPluginAction.<init>(EditorPluginAction.java:34)
at org.eclipse.ui.internal.ActionDescriptor.createAction(ActionDescriptor.java:256)
at org.eclipse.ui.internal.ActionDescriptor.<init>(ActionDescriptor.java:170)
at org.eclipse.ui.internal.ViewerActionBuilder.createActionDescriptor(ViewerActionBuilder.java:53)
at org.eclipse.ui.internal.PluginActionBuilder.readElement(PluginActionBuilder.java:158)
at org.eclipse.ui.internal.ViewerActionBuilder.readElement(ViewerActionBuilder.java:88)
at org.eclipse.ui.internal.registry.RegistryReader.readElements(RegistryReader.java:138)
at org.eclipse.ui.internal.registry.RegistryReader.readElementChildren(RegistryReader.java:127)
at org.eclipse.ui.internal.PluginActionBuilder.readElement(PluginActionBuilder.java:141)
at org.eclipse.ui.internal.ViewerActionBuilder.readElement(ViewerActionBuilder.java:88)
at org.eclipse.ui.internal.registry.RegistryReader.readElements(RegistryReader.java:138)
at org.eclipse.ui.internal.registry.RegistryReader.readExtension(RegistryReader.java:149)
at org.eclipse.ui.internal.registry.RegistryReader.readRegistry(RegistryReader.java:170)
at org.eclipse.ui.internal.PluginActionBuilder.readContributions(PluginActionBuilder.java:112)
at org.eclipse.ui.internal.ViewerActionBuilder.readViewerContributions(ViewerActionBuilder.java:106)
at org.eclipse.ui.internal.PopupMenuExtender.readStaticActionsFor(PopupMenuExtender.java:452)
at org.eclipse.ui.internal.PopupMenuExtender.<init>(PopupMenuExtender.java:132)
at org.eclipse.ui.internal.PartSite.registerContextMenu(PartSite.java:118)
at org.eclipse.ui.internal.EditorSite.registerContextMenu(EditorSite.java:165)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3282)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:378)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.createPartControl(JavaEditor.java:2618)
at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.createPartControl(CompilationUnitEditor.java:1416)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:263)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2739)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2651)
at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPage.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2590)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2574)
at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:340)
at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.java:328)
at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.java:190)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
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:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
Assuming Update would cure the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Set Compiler compliance Level to 1.4.XX. "Enum" is an reserved word in Java5 and higher.
Regards,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Of course it is a reserved keyword in 1.5, and I want to use that keyword in the way it is intended to be used in 1.5.
same happens for:
public enum Test {
}
So setting compiler compliance to 1.4 is not a solution to my problem. I want to use Enum's as defined in 1.5, and NWDS can't cope with opening such enum's (though as I said, if I open a "class" and change it to be an enum, the editor works fine).
Hi,
Go to Window Preferences->Java->Compiler->
Set the Compiler compliance level to 5.0.
Hope it should resolve your error.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but the Setting already was on 5.0, and setting it to 6.0 also did not help.
Note that I can create a java class, open it, then change it to be an enum, and then edit it.
Highlighting and errors are then adequate for a java enumeration.
However closing the editor and reopening it will yield the same Exeption, of course.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.