-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Upgrading to 2.24.1 produces a compile time warning: BaselineIgnore not found #3110
Comments
Hi @lbergelson, It's ironic that adding annotations for third-party static code analysis tools, causes warnings in Oracle's
If you disable
We have considered both solutions and each one comes at a cost. Currently we are using the following annotations, which all have their specificity:
Adding annotations to the
|
Thank you for the in depth response. It sounds like you've done a lot more thinking about than this than I have. It was just a surprising gotcha to trip over for me. I had never seen that warning pop up before, but missing class files sounded worrisome so I didn't want to disable it in general. It sounds like it's extremely niche and not gaining us much though. I've worked around it and you're obviously aware so I'll close this out. |
Since |
Outdated `@BaselineIgnore` annotation are no longer needed to successfully build newer versions. Until [JDK-8342833](https://bugs.openjdk.org/browse/JDK-8342833) is resolved, these annotations cause linter warnings during compilation (see #3110 for example), so it is better to remove them as soon as they are no longer used.
Outdated `@BaselineIgnore` annotation are no longer needed to successfully build newer versions. Until [JDK-8342833](https://bugs.openjdk.org/browse/JDK-8342833) is resolved, these annotations cause linter warnings during compilation (see #3110 for example), so it is better to remove them as soon as they are no longer used.
[JSpecify](https://jspecify.dev/) is a nullability annotation library with a [large list of supporters](https://jspecify.dev/about/). It is the recommended library to solve [LOG4J2-1477](https://issues.apache.org/jira/browse/LOG4J2-1477). The usage of JSpecify as `provided` library has however a drawback: if users don't have JSpecify on their stack, they'll get a Javac Linter warning whenever they use a class with nullability annotations (see [#3110](#3110) for example. Since JSpecify is an annotation with `RUNTIME` retention and is not covered by [JDK-8342833](https://bugs.openjdk.org/browse/JDK-8342833), the easiest solution provided by this PR is: - Move JSpecify from the `provided` to the `compile` scope. This will inflate users dependency stack by a whooping 4000 bytes. - Mark JSpecify as optional for OSGi and JPMS, so users can exclude the dependency if they wish to do it. In practice, this change should be neutral for users and will allow us to add nullability annotations to important class, such as `Logger` without breaking the build of users that use the [`-Werror` compiler flag](https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-Werror).
Description
We're trying to update from 2.17.1 -> 2.24.1 but we've encountered compile warnings due to missing annotations. It looks like essentially the same same issue as #2144 and #2232
Configuration
Version:. 2.24.1
Operating system: OSX Sonoma 14.4
JDK:
openjdk 17.0.12 2024-07-16
OpenJDK Runtime Environment Homebrew (build 17.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.12+0, mixed mode, sharing)
Logs
Reproduction
Update log4j to 2.24.1 in our build.gradle
This was very surprising to me. Have you considered changing the annotation dependencies to be included. Or they processed out of the published jar?
We need to include
log4j-core
at compile time, because we want to change the default logging level at runtime based on command line input from the user. If there is a way to do this through the API we would be happy to switch.I've solved the warning by adding 2 additional dependencies
Just adding
biz.aQute.bnd:biz.aQute.bnd.annotation
causes additional failures because it includes OSGI bundle annotations which are not included in it's dependency list.I feel like I'm doing something wrong but I'm not really sure what I should be doing instead.
The text was updated successfully, but these errors were encountered: