[jdk16] Integrated: 8258515: javac should issue an error if an annotation is nested in a local class or interface

Vicente Romero vromero at openjdk.java.net
Thu Dec 17 18:11:59 UTC 2020


On Thu, 17 Dec 2020 15:27:48 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> Spec [1](http://cr.openjdk.java.net/~gbierman/8246771/8246771-20200928/specs/local-statics-jls.html), section 9.6 Annotation Interfaces states that:
> 
> "It is a compile-time error if an annotation declaration is nested within the body of a local class or interface declaration (14.3), or within the body of an anonymous class"
> 
> javac is not implementing this assertion. The proposed patch is fixing this issue,
> 
> TIA

This pull request has now been integrated.

Changeset: 47c180da
Author:    Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.java.net/jdk16/commit/47c180da
Stats:     129 lines in 10 files changed: 105 ins; 0 del; 24 mod

8258515: javac should issue an error if an annotation is nested in a local class or interface

Reviewed-by: jjg

-------------

PR: https://git.openjdk.java.net/jdk16/pull/43


More information about the compiler-dev mailing list