Bug 110251 - Inaccurate problem description on bad nested class
Summary: Inaccurate problem description on bad nested class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.2 M3   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-21 16:54 EDT by Piotr Kaminski CLA
Modified: 2005-10-28 14:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kaminski CLA 2005-09-21 16:54:19 EDT
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 {}
  };
}
Comment 1 Olivier Thomann CLA 2005-09-21 17:27:52 EDT
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.
Comment 2 Piotr Kaminski CLA 2005-09-21 17:48:59 EDT
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.
Comment 3 Philipe Mulet CLA 2005-09-22 03:12:19 EDT
Will let our native decide on the proper wording.
Note this change shouldn't apply to 3.1 maintenance, due to translating issues.
Comment 4 Kent Johnson CLA 2005-09-29 15:02:18 EDT
Changed the error message as suggested & updated 2 tests in NegativeTest.
Comment 5 Olivier Thomann CLA 2005-10-28 14:04:38 EDT
Verified for 3.2 M3 using build I20051025-0800+JDT/Core v_618a