-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8370800: Downgrade cant.attach.type.annotations diagnostics to warnings #28018
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
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back cushon! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
Webrevs
|
|
So, overall, I am not convinced this is a good move. Yes, we have some existing cases where missing stuff produces just warnings in the class reader, but these are cases where annotations, or their attributes, are missing. Not when the actual field/method type is missing. I.e. in the test case, not producing an error for missing But, even if we decided to ignore the missing class error, the implementation is, sadly, wrong. We cannot just ignore the leads to: I think that if you really want to ignore the Second problem is that catching the |
|
Thanks very much for the review!
I had been thinking about it similarly, that it would be better to report and error and just add the missing transitive deps. I've heard feedback about a couple of cases where the code owners didn't want to do that, because the deps were only used for thinks like Overall it might make sense to move this back to a draft and collect more feedback in the bug.
Thanks! I experimented with doing that and it avoids the crash, and I have pushed those changes to the PR, but I realize that doesn't fully solve the issues you raised and this needs more thought and discussion.
Yes, I guess to continue with this approach of trying to recover from the I do think that's a somewhat rare issue. If these diagnostics did end up getting downgraded to warnings, compilations that are relying on accurate type annotation information would likely want to promote them to errors. And the examples in the bug weren't generally trying to read the type annotations, they just wanted compilation to succeed with incomplete classpaths. |
Hi, please consider this fix for JDK-8370800: Downgrade cant.attach.type.annotations diagnostics to warnings.
As discussed in the, this reduces the compatibility impact of these diagnostics for builds that deliberately omit transitive annotation dependencies, for example if they are only referenced through javadoc
@linktags, or by frameworks that conditionally load the classes.The PR changes the existing error diagnostic to an unconditional warning. Another alternative would be to make it an optional xlint diagnostic, perhaps as part of
-Xlint:classfile, or as another category.Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28018/head:pull/28018$ git checkout pull/28018Update a local copy of the PR:
$ git checkout pull/28018$ git pull https://git.openjdk.org/jdk.git pull/28018/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28018View PR using the GUI difftool:
$ git pr show -t 28018Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28018.diff
Using Webrev
Link to Webrev Comment