ACC_FINAL flag for an anonymous class was unset since JDK 1.3. This has
been changed in JDK 6 after bug 6219964 was fixed. For compatibility reason,
ACC_FINAL flag for anonymous classes should remain unset. See bug 4777101 for
Webrev is attached. It's also available at:
This is a regression introduced when bug 6219964 was fixed.
JLS 15.9.5 states that "An anonymous class is always implicitly final", which means
that an anonymous class cannot be subclassed. However, at class file level, we will
keep ACC_FINAL for anonymous classes unset to maintain compatibility with earlier