Community
Participate
Working Groups
Compiling this code with Eclipse compiler: public enum X { A, B, C; } produces a valueOf(String) method that is final. javac doesn't set it as final. Also the java.lang.Thread.State enum doesn't set its valueOf(String) method as final.
Created attachment 41041 [details] Proposed fix
Ok for fixing SyntheticMethodBinding. According to JLS 8.9, both methods should be not final. Not only one, as Thread.State seems to expect.
I'd be tempted to fix both cases (VALUES and VALUEOF). Not just one. Now, I don't think this is critical for RC4.
javac 1.6 b82 makes #values final still...
Created attachment 41049 [details] New patch Remove final for both values() and valueOf(String) to match the JLS3
Created attachment 41052 [details] Updated regression tests
Re: comment 4. This got confirmed as a bug in javac: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6424358
Given this is a trivial fix, and it may impact JCL team (since modifier is made visible in generated javadoc), I am proposing to fix this for RC4. +1 for 3.2RC4 Dani/Martin: pls cast your vote
Martin - pls vote
Tuned EnumTest#test079,test094 to remove "final" expectations
Added EnumTest#test129
Patch is OK - approving for 3.2 RC4.
+1 for 3.2RC4
Fix released.
Verified with I20060511-2000 for 3.2RC4