Community
Participate
Working Groups
The following (presumably illegal?) code will flag an "Illegal modifier for the local class Nested;" (so far so good) "only one of abstract or final is permitted" when no such modifiers are present. class Test { private Object o = new Object() { private static class Nested {} }; }
I don't see what is wrong with this error message. It says that in this context only final or abstract or none would be legal. If you try any of these choices, it compiles fine.
Ah, I interpreted the message as meaning "you specified both abstract and final but can only use one of them". Perhaps rephrasing as "only abstract or final is premitted" would be clearer? It's a small change, but carries a completely different connotation. The old message could then be left for the cases where somebody tries to use both modifiers. If you think it's too trivial, just close the bug -- sorry.
Will let our native decide on the proper wording. Note this change shouldn't apply to 3.1 maintenance, due to translating issues.
Changed the error message as suggested & updated 2 tests in NegativeTest.
Verified for 3.2 M3 using build I20051025-0800+JDT/Core v_618a