final inner class not final (was Re: Code review request: 7064075 Security libraries don't build with javac -Xlint:all, -deprecation -Werror)
David Holmes
David.Holmes at oracle.com
Fri Aug 5 01:54:14 UTC 2011
Max,
See 6520152. For backward compatability anonymous inner classes don't
have the ACC_FINAL bit set.
David
Weijun Wang said the following on 08/04/11 12:24:
>> serialVersionUID warnings for classes that have had different
>> generated serialVersionUID's in the past.
>>>> sun.security.pkcs11.P11TlsPrfGenerator$1
>>>> -currently: -8090049519656411362L;
>>>> -JDK 6: -3305145912345854189L;
>
> I find out the reason:
>
> Since 6u11, a final inner class is *not* final anymore.
>
> $ cat A4.java
> import java.lang.reflect.Modifier;
> public class A4 {
> public static void main(String[] args) throws Exception {
> Class c = Class.forName(args[0]);
> System.out.println(c.getModifiers() & Modifier.FINAL);
> }
> }
> $ java A4 java.lang.String
> 16
> $ java A4 'sun.security.pkcs11.P11TlsPrfGenerator$1'
> 0
>
> getModifiers() is a native method, and calls JVM_GetClassModifiers. Is
> this an intended change?
>
> FYI, the class is defined as
>
> private static final SecretKey NULL_KEY = new SecretKey() {
> ....
>
> in
> http://hg.openjdk.java.net/jdk8/tl/jdk/file/809e8db0c142/src/share/classes/sun/security/pkcs11/P11TlsPrfGenerator.java,
> line 100.
>
>
> Thanks
> Max
More information about the security-dev
mailing list