Bug 85397 - [1.5][enum] erroneous strictfp keyword on enum type produces error on constructor
Summary: [1.5][enum] erroneous strictfp keyword on enum type produces error on constru...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 minor (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-16 08:20 EST by Tom Hofmann CLA
Modified: 2005-03-30 22:56 EST (History)
1 user (show)

See Also:


Attachments
Apply on HEAD (1.06 KB, patch)
2005-02-16 10:30 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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