-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
@Nullable prevents code from being compiled with -Werror #25095
Comments
Indeed, Java compiler does not trigger warning for missing annotations from the classpath except sadly when it is using such enum attribute, and we must use it. Notice this warning appears only if you are using null-safety annotations in your codebase, so end user projects won't see it until they start using our null-safety annotations in their codebase which has been evaluated as reasonably fine for Spring Framework and Spring Data. I recommend using |
Assuming that this is not a regression in a specific place but rather the same general problem since 5.0, there is indeed no way out for the time being. I'd recommend adding the dependency as well since |
@sdeleuze Is there an issue to follow for this, to not have to have the explicit include?
|
Ah, I guess it's this? |
Yes, but we may update our plans based on a potential nullness future JEP. I will update the issue you linked as we learn more. |
I'd like to point out that this issue could be "resolved" to some extent by simply switching findbugs jsr305 dependency to |
Affects: 5.2.6.RELEASE
Code that uses
@Nullable
cannot be compiled with-Werror
due to the use ofWhen.MAYBE
on its@Nonnull
meta-annotation. Attempting to compile code that depends onspring-core
and that uses@Nullable
results in a compilation failure:Unfortunately, there's no way to suppress such warnings so I either have to abandon trying to compile with
-Werror
or I have to add a dependency oncom.google.code.findbugs:jsr305:3.0.2
.The text was updated successfully, but these errors were encountered: