Community
Participate
Working Groups
With Eclipse I20050506-1600, I run a problem to create a inner class in enum: 1. select an enum in the package explorer 2. call new wizard to create a inner class 3. check the "Enclosing type" 4. Put a name in the "Name:" Field 5. Click the button "OK". I got the following exception: Caused by: java.lang.IllegalArgumentException: Node does not exist at org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertBefore (ListRewrite.java:205) at org.eclipse.jdt.internal.core.CreateElementInCUOperation.insertASTNode (CreateElementInCUOperation.java:249) at org.eclipse.jdt.internal.core.CreateElementInCUOperation.generateNewCompilation UnitAST(CreateElementInCUOperation.java:184) at org.eclipse.jdt.internal.core.CreateElementInCUOperation.executeOperation (CreateElementInCUOperation.java:137) at org.eclipse.jdt.internal.core.JavaModelOperation.run (JavaModelOperation.java:718) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1716) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation (JavaModelOperation.java:782) at org.eclipse.jdt.internal.core.SourceType.createType (SourceType.java:153) at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.createType (NewTypeWizardPage.java:1808) at org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard.finishPage (NewClassCreationWizard.java:55) at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run (NewElementWizard.java:114) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation (BatchOperation.java:39) at org.eclipse.jdt.internal.core.JavaModelOperation.run (JavaModelOperation.java:718) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1716) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:3654) at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run (WorkbenchRunnableAdapter.java:87) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:346) The samething can be done in Java editor.
I will investigate.
Could not reproduce in I20050512-1200. Closing as WORKSFORME. Please reopen if you get it again.
I have tested with M7. The problem still exists.
Then provide steps to reproduce. I followed the steps in comment 0 and I could not reproduce. Are your project's settings 5.0 or 1.4?
I remind you it occurs if you create a class/interface in an ENUM It works in Java editor.
This is exactly what I have done.
Reproduced. I tried with an empty enum and it was working. I am investigating.
The problem comes from the new type wizard that sets the sibling of the new type to be an enum constant declaration. This leads to the error see in the log. I think that the createType API should throw an INVALID_SIBLING java modl exception in this case. See bug 95480 for the corresponding problem on the JDT/Core side. Move to JDT/UI
Created attachment 21234 [details] Apply on HEAD Possible patch. For an enum type, I check the IFields and I select the first one that is not an enum constant declaration as the sibling of the new type.
released > 20050524 Thanks Olivier!
Verifying...
Verified in I20050527-1300. Dirk, please update state to VERIFIED.
Marking as verified.