Repository navigation
Conversation
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
Stephan202
left a comment
There was a problem hiding this comment.
Added some context. CC @msridhar. Let me know if for any/all of the flagged issues I should file a GitHub issue over at NullAway; happy to do so!
There was a problem hiding this comment.
All the places in which I had to add requireNonNull are genuinely cases where we can't reasonably expect NullAway to infer the non-nullness invariant. π
There was a problem hiding this comment.
This is cool but I'm not sure why it's not detected outside JSpecify mode π€ Is there anything related to generics here?
There was a problem hiding this comment.
If you want I can file an issue for this one as well, though since it's not a bug as far as this project is concerned: also happy to leave it.
There was a problem hiding this comment.
I think I figured this one out; it's probably uber/NullAway#1144.
There was a problem hiding this comment.
Without this version declaration builds with JDK 23+ fail with:
[WARNING] Cannot find annotation method 'when()' in type 'javax.annotation.Nonnull': class file for javax.annotation.Nonnull not found
[WARNING] /home/sschroevers/workspace/picnic/error-prone-support/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java: unknown enum constant javax.annotation.meta.When.MAYBE
reason: class file for javax.annotation.meta.When not found
(This causes a failure because we build with -Werror.)
It's rather ironic that enabling JSpecify mode forces one to add a "competing" dependency to the classpath. π
There was a problem hiding this comment.
Hrm, this is a weird one! Particularly that it's tied to JSpecify mode, I have no idea what's going on. Can you file an issue for this one?
There was a problem hiding this comment.
Sure! I'll first try to narrow down which aspect of ReactorRules triggers the issue.
There was a problem hiding this comment.
As the type parameters aren't @Nullable, I would expect NullAway to understand that Table.Cell::getRowKey and do not return null. But without the suppression we get:
[WARNING] /home/sschroevers/workspace/picnic/error-prone-support/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableTableRules.java:[64,23] [NullAway] referenced method returns @Nullable, but functional interface method java.util.function.Function.apply(T) returns @NonNull
(see http://t.uber.com/nullaway )
[WARNING] /home/sschroevers/workspace/picnic/error-prone-support/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableTableRules.java:[64,46] [NullAway] referenced method returns @Nullable, but functional interface method java.util.function.Function.apply(T) returns @NonNull
(see http://t.uber.com/nullaway )
[WARNING] /home/sschroevers/workspace/picnic/error-prone-support/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ImmutableTableRules.java:[64,72] [NullAway] referenced method returns @Nullable, but functional interface method java.util.function.Function.apply(T) returns @NonNull
(see http://t.uber.com/nullaway )
There was a problem hiding this comment.
This one could be a combination of uber/NullAway#1075 and uber/NullAway#1128. I'm hoping that uber/NullAway#1128 will fix it. Could you somehow like this from uber/NullAway#1128 so we can test if a fix for that issue fixes this one?
There was a problem hiding this comment.
There are many similar expressions. NullAway can be appeased by simply replacing Mono<@Nullable Void> with Mono<Void>, but then VoidMissingNullable complains.
There was a problem hiding this comment.
Please file an issue on this one. We have hacks for @Nullable Void but we should disable them in JSpecify mode.
3accab7 to
7eb979d
Compare
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
7eb979d to
95c0a22
Compare
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
2 similar comments
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
4330736 to
60d9f56
Compare
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
|
I rebased the branch onto #1616 and added a commit. Two notes:
Thanks for all the help @msridhar! π |
Yeah this is the main reason we cut 0.12.6 π uber/NullAway#1176 led to the same crash |
|
(Pitest correctly complains about a lack of coverage in |
9369cd3 to
248ac4b
Compare
mohamedsamehsalah
left a comment
There was a problem hiding this comment.
LGTM π
(Pitest correctly complains about a lack of coverage in AnnotationAttributeMatcher. That relates to this comment. Something we should fix, but I consider it out of scope for this PR. Up to @rickie and @mohamedsamehsalah to more carefully review the change in that particular class π.)
Refactored logic looks sound to me βοΈ
60d9f56 to
6ef1c6e
Compare
|
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
|
This PR was accidentally merged into #1616. There it was amended to include the following changes: diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java
index 58384d2c..955d3753 100644
--- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java
+++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/refasterrules/ReactorRules.java
@@ -515,8 +515,13 @@ final class ReactorRules {
mono.switchIfEmpty(Mono.empty()), mono.flux().next(), mono.flux().singleOrEmpty());
}
+ // XXX: Consider filing a SonarCloud issue for the S2637 false positive.
@BeforeTemplate
- @SuppressWarnings("java:S4968" /* Result may be `Mono<Void>`. */)
+ @SuppressWarnings({
+ "java:S2637" /* False positive: result is never `null`. */,
+ "java:S4968" /* Result may be `Mono<Void>`. */,
+ "key-to-resolve-AnnotationUseStyle-and-TrailingComment-check-conflict"
+ })
Mono<? extends @Nullable Void> before2(Mono<@Nullable Void> mono) {
return Refaster.anyOf(mono.ignoreElement(), mono.then());
}
@@ -970,8 +975,13 @@ final class ReactorRules {
return flux.ignoreElements().then();
}
+ // XXX: Consider filing a SonarCloud issue for the S2637 false positive.
@BeforeTemplate
- @SuppressWarnings("java:S4968" /* Result may be `Mono<Void>`. */)
+ @SuppressWarnings({
+ "java:S2637" /* False positive: result is never `null`. */,
+ "java:S4968" /* Result may be `Mono<Void>`. */,
+ "key-to-resolve-AnnotationUseStyle-and-TrailingComment-check-conflict"
+ })
Mono<? extends @Nullable Void> before2(Flux<@Nullable Void> flux) {
return flux.ignoreElements();
} |



This is a draft PR on top of #1598, to demonstrate the benefits and gotchas of running NullAway in JSpecify mode.
Suggested commit message.