RFR: 8231436: Fix the applicability of a no- at Target annotation type

Liam Miller-Cushon cushon at openjdk.java.net
Wed Feb 3 18:22:41 UTC 2021

On Tue, 2 Feb 2021 11:03:17 GMT, Guoxiong Li <github.com+13688759+lgxbslgx at openjdk.org> wrote:

>> From this follow up here: https://mail.openjdk.java.net/pipermail/compiler-dev/2019-September/013715.html my interpretation is that this bug was intended to widen it to all contexts, including type use. This has been changed in JLS but not in the normative javadoc and also not in the compiler. I believe we should keep declarations only, and back out the change to JLS.
> Maybe we should collect the concrete information about this problem. Here are some materials that I know.
> Order by time:
> - 2019.08 **Werner Dietl** launched the discussion. [1]
> - 2019.09 After the discussion between **Alex Buckley** and **Michael Ernst**, an initiative result came out.[2]
> - 2019.09 Two JBS issues were filed. [3][4]
> - 2019.12 **Alex Buckley** fixed the JLS(fix version: 14). But the compiler code and javadoc were not fixed. [5][6]
> - 2020.10 **Christian Stein** created another issue about it. [7]
> - 2020.10 **Guoxiong Li**(me) submitted a PR about it in Github. [8]
> - 2020.10 **Joel Borggrén-Franck** restarted the discussion about the specification. [9]
> - 2020.12 Because the JDK16 was nearly at RDP1, we decided to only fix JDK-8254023. And other work left to JDk17.  [7][10][11]
> - 2020.12 The issue JDK-8254023 was fixed at JDK16. [7][8][12]
> - **Now, we need to discuss the problem(unify the specification, implement and javadoc) that JDK16 has left.**[11]
> [1] https://mail.openjdk.java.net/pipermail/compiler-dev/2019-August/013666.html
> [2] https://mail.openjdk.java.net/pipermail/compiler-dev/2019-September/013705.html
> [3] https://bugs.openjdk.java.net/browse/JDK-8231435
> [4] https://bugs.openjdk.java.net/browse/JDK-8231436
> [5] https://docs.oracle.com/javase/specs/jls/se14/html/jls-9.html#jls-
> [6] https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/annotation/Target.html
> [7] https://bugs.openjdk.java.net/browse/JDK-8254023
> [8] https://github.com/openjdk/jdk/pull/622
> [9] https://mail.openjdk.java.net/pipermail/compiler-dev/2020-October/015197.html
> [10] http://openjdk.java.net/projects/jdk/16/
> [11] https://mail.openjdk.java.net/pipermail/compiler-dev/2020-December/015503.html
> [12] https://github.com/openjdk/jdk16/pull/34

Thanks, I was missing context here. I now realize this patch is fixing a bug related to [JDK-8254023](https://bugs.openjdk.java.net/browse/JDK-8254023)--when the handling of annotations without `@Target` was updated to allow them to be applied to module declarations, the handling of repeatable annotations without `@Target` should also have been updated. I filed a new bug for the sub-issue that this patch is fixing, and will update it accordingly in a minute: https://bugs.openjdk.java.net/browse/JDK-8261088

I'm also happy to help with any work to be done on the larger question of interpreting `@Target`-less annotations as applicable to type contexts, if there's agreement about what to do there.


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

More information about the compiler-dev mailing list