--- old/src/share/classes/com/sun/tools/javac/comp/Attr.java 2014-03-07 10:50:43.279747098 +0400 +++ new/src/share/classes/com/sun/tools/javac/comp/Attr.java 2014-03-07 10:50:42.559756150 +0400 @@ -2111,10 +2111,8 @@ // // This expression is then *transformed* as follows: // - // (1) add a STATIC flag to the class definition - // if the current environment is static - // (2) add an extends or implements clause - // (3) add a constructor. + // (1) add an extends or implements clause + // (2) add a constructor. // // For instance, if C is a class, and ET is the type of E, // the expression @@ -2131,7 +2129,13 @@ // } // ... // } - if (Resolve.isStatic(env)) cdef.mods.flags |= STATIC; + // + // NOTE: STATIC flag used to be added to the class + // definition in a static environment. + // However, according to JLS: 15.9.5: + // "An anonymous class is never static" + // So, it is not added anymore. + // if (clazztype.tsym.isInterface()) { cdef.implementing = List.of(clazz);