Bug 85397

Summary: [1.5][enum] erroneous strictfp keyword on enum type produces error on constructor
Product: [Eclipse Project] JDT Reporter: Tom Hofmann <eclipse>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: philippe_mulet
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Apply on HEAD none

Description Tom Hofmann CLA 2005-02-16 08:20:27 EST
I20050215-2300 (M5 test pass)

- have this code:

strictfp enum Natural {
	ONE, TWO;
}

expected: strictfp is not allowed on the enum type
actual: no error is reported

- alternatively, have this code:

strictfp enum Natural {
	ONE, TWO;
	
	private Natural() {
	}
}

expected: the wrong modifier is reported with the type name 'Natural'
actual: the error is shown for the constructor
Comment 1 Olivier Thomann CLA 2005-02-16 10:26:05 EST
strictfp seems to be allowed on Enum types.
The second case should not report a problem.
Comment 2 Olivier Thomann CLA 2005-02-16 10:30:23 EST
Created attachment 17988 [details]
Apply on HEAD

This is fixing the second error.
Comment 3 Olivier Thomann CLA 2005-02-21 13:07:39 EST
strictfp is allowed as an enum type modifier, but it is not allowed as a
constructor modifier.
If the enum type is set as strictfp, the constructor binding is also set as
strictfp as well as the enum synthetic methods (valueOf and values).
Philippe, I will add this support in the binding of these synthetic methods.

So the only modifier that can be set in the source for an enum constructor is
private.
Comment 4 Olivier Thomann CLA 2005-02-22 10:19:14 EST
Fixed and released in HEAD.
Regression test added in EnumTest.test079
Comment 5 Olivier Thomann CLA 2005-03-30 22:56:31 EST
Verified in 20050330-0500