RFR: 8254023: A module declaration is not allowed to be a target of an annotation that lacks an @Target meta-annotation
jfranck at openjdk.java.net
Tue Dec 15 15:04:57 UTC 2020
On Fri, 11 Dec 2020 16:32:23 GMT, Guoxiong Li <github.com+13688759+lgxbslgx at openjdk.org> wrote:
>>> I don't think TargetAnnoCombo should be updated, at least not for this fix. It is an old hard to understand test that predates modules.
>>> It would be good to do further testing as Vicente writes. I suggest:
>>> 1. A test that the module info compiles, you already have this.
>>> 2. A test that the class file contains the bytes for the annotation might make sense. As Jon has pointed out in different review threads there is the toolbox, perhaps that could be of use? There are some examples of toolbox tests in `jdk/test/langtools/tools/javac/modules` though I don't have a good example of one that verifies the contents of the class file. Perhaps @vicente-romero-oracle can point to an example?
>> it is probably an overkill but method: `testAnnos` in test: `test/langtools/tools/javac/records/RecordCompilationTests.java` is an example applied to records that could be adapted to what we want here
> I added two test cases. Thank you for taking the time to review.
This looks good to me. Since this is targeted to Java 16 we need to close this PR and open a new PR towards the JDK16 project and finish the review there, add a link back to this PR would also be neat. Can you do that?
More information about the compiler-dev