final inner class not final (was Re: Code review request: 7064075 Security libraries don't build with javac -Xlint:all, -deprecation -Werror)

Weijun Wang at
Wed Aug 3 19:24:44 PDT 2011

> serialVersionUID warnings for classes that have had different
> generated serialVersionUID's in the past.
>>> -currently: -8090049519656411362L;
>>> -JDK 6: -3305145912345854189L;

I find out the reason:

Since 6u11, a final inner class is *not* final anymore.

$ cat
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
$ java A4 '$1'

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() {

line 100.


More information about the security-dev mailing list