Bug 227527

Summary: [1.5][compiler] Useless error message for local enum
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.4   
Target Milestone: 3.5 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch with testcase none

Description David Audel CLA 2008-04-17 07:28:05 EDT
build I20080415-1646

public class X {
	void foo() {
		abstract enum E {
			
		}
	}
}

This test case produce the following error message:
'The member enum E cannot be local'

The error message catalog the following entry can be found:
752 = Illegal modifier for the local enum {0}; only abstract is permitted

This seems useless as enum cannot be local and cannot be abstract.
Comment 1 Kent Johnson CLA 2008-09-12 14:27:17 EDT
Created attachment 112454 [details]
Proposed patch with testcase

Removed the check in ClassScope that checked anonymous enum types since it was redundant

Extended EnumTest test003 with an anonymous type for an enum constant

Other existing tests show that errors for local enum types are reported correctly
Comment 2 Kent Johnson CLA 2008-10-03 12:20:27 EDT
Fix and test released for 3.5M3
Comment 3 David Audel CLA 2008-10-27 08:05:40 EDT
Verified for 3.5M3 using I20081026-2000 build.