RFR: 8263153: AssertionError at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)

Vicente Romero vromero at openjdk.java.net
Tue Nov 2 16:25:14 UTC 2021


On Tue, 2 Nov 2021 11:23:05 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> Currently, the compiler doesn't `annotate` the internal type annotations of the annotation element value so that the field `JCAnnotation.attribute` is `null` and the compiler crashes. This patch adds the missed scaning step and the corresponding test case.
> 
> Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

approved with minor suggestion, thanks for fixing this!

nit: please sync this PR title with the but title in JIRA

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java line 677:

> 675: 
> 676:         // Scan the annotation element value and then attribute
> 677:         // the internal annotations to prevent the compiler from crashing

I would remove the: `to prevent the compiler from crashing` part, suggestion:


Scan the annotation element value and then attribute nested
annotations if present

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

Marked as reviewed by vromero (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/6210


More information about the compiler-dev mailing list