Repository navigation
Conversation
… when dependency has optional annotations with enums
|
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
|
@lahodaj This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 37 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
cushon
left a comment
There was a problem hiding this comment.
This LGTM, for what it's worth.
bazelbuild/bazel#5985 is another example of these warnings causing problems, I think putting them behind -Xlint:classfile makes sense.
| return new Attribute.Compound(annotationType, buf.toList()); | ||
| } finally { | ||
| if (!annotationType.tsym.type.hasTag(TypeTag.ERROR)) { | ||
| //if the annotation type does not exists |
There was a problem hiding this comment.
typo: "should not exist" (not exists)
|
@lahodaj, thanks so much for picking this up. Would you mind giving the community some extra time to evaluate the effects of this change before integrating it, please? FWIW, I will link certain issues that I know of are affected by this change:
I'm pretty sure there are hundreds of more out there in the wild. |
There was a problem hiding this comment.
Copyright year needs to be updated.
|
@Vampire has reported that this helps with Log4j: apache/logging-log4j2#4034 (comment) |
|
/integrate |
|
Going to push as commit 26bb357.
Your commit was automatically rebased without conflicts. |
Consider snippet like:
javac will currently handle the 3 unresolvable aspects completely differently:
UnresolvableAnnotation, there is no error, and no warning,unresolvable(attribute), there's no error, and a lint warning bound to-Xlint:classfile,UnresolvableEnum(either the enum type, or an enum constant), there's no error, and an unconditional warning.Note that the attribute method may primarily be unresolvable, because the annotation type is unresolvable.
This appears to cause issues for projects that read classfiles with annotations, but don't have the corresponding annotation API on the classpath.
The proposal herein is twofold:
UnresolvableEnumwill now be an-Xlint:classfilewarning as well, so it will be suppressible. This is for consistency.Note that if the annotation type is resolvable, than the warnings for the nested elements will continue to be reported. Such cases either means a wrong version of the annotation/enum type was used, or a likely classpath misconfiguration, and hence the warning does not see unwarranted there.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/29818/head:pull/29818$ git checkout pull/29818Update a local copy of the PR:
$ git checkout pull/29818$ git pull https://git.openjdk.org/jdk.git pull/29818/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 29818View PR using the GUI difftool:
$ git pr show -t 29818Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/29818.diff
Using Webrev
Link to Webrev Comment