Community
Participate
Working Groups
When using the UI to create a new type inside an enum type that contains some enum constants, an IllegalArgumentException is thrown. See bug 94304. The problem comes from the fact that an enum constant is seen as a valid sibling for the new type. This should indeed be an invalid sibling and there is a corresponding java model status for that. The same problem should apply for createField or createMethod if the sibling is an enum constant declaration. Right now it is not possible to create an enum constant declaration using the APIs on IType. Therefore an enum constant declaration is always an invalid sibling.
Reproduced with 3.3 RC4
To reproduce, first undo the fix from bug 94304 comment 9.
The bug is still there. However people should now use ASTRewrite to modify the source. This makes this bug less important. Deferring post 3.4
Created attachment 104673 [details] Proposed fix and regression test
Fix and test released for 3.5M1
Verified for 3.5M1 using I20080805-1307