New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8254023: A module declaration is not allowed to be a target of an annotation that lacks an @Target meta-annotation #622
Conversation
…otation that lacks an @target meta-annotation
Hi @lgxbslgx, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user lgxbslgx" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
/signed |
Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
Webrevs
|
Hello, Thank you for the contribution. As you can see from the @target javadoc ( https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/annotation/Target.html ) there is some ambiguity here. I have rased a separate discussion on compiler-dev, depending on the outcome of that discussion this patch will need to be revised. |
Thanks for focusing on this patch. I will continue to follow the discussion and revise my patch based on the outcome of the discussion. |
@lgxbslgx This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@jbf According to your comments, I revise my code to only fix JDK-8254023. |
the change looks good but I'm surprised that no other tests are failing and need changes, in particular tests like: |
@vicente-romero-oracle It is difficult to identify which test should be changed, because all the tests passed. As you said, the |
sure please, I think that you should not only check that that test passes but also modify it, explicitly adding cases for the MODULE target. As a general comment this change is simple but the implications are not. I think the patch needs to add more tests. We also need to test that annotation processors can |
Hi, 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:
|
it is probably an overkill but method: |
@lgxbslgx this pull request can not be integrated into git checkout JDK-8254023
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
# Conflicts: # test/langtools/tools/javac/modules/AnnotationProcessing.java
I added two test cases. Thank you for taking the time to review. |
Hi @lgxbslgx 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? cheers |
@jbf Unknown command |
@jbf I open a new PR in JDK 16. Please see openjdk/jdk16#34 |
The later work will be completed in JDK 16. |
Hi all,
The Java Language Specifications(JLS), from 8 to 13 included, state it as below:
The JLS 14 and 15 state it as below:
This patch adds
names.MODULE, names.TYPE_PARAMETER, names.TYPE_USE
tocom.sun.tools.javac.comp.Check.dfltTargetMeta
to fix this issue.Thank you for taking the time to review.
Best Regards.
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/jdk pull/622/head:pull/622
$ git checkout pull/622