-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Introduce JSpecify for nullability annotations #4091
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
Conversation
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
…otations.NullMarked Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
…ing imports Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
|
|
||
| @Nullable | ||
| public Object scanUnsafe(Attr key) { | ||
| public @Nullable Object scanUnsafe(Attr key) { |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
Scannable.scanUnsafe
This method overrides
InnerProducer.scanUnsafe
|
|
||
| @Nullable | ||
| public abstract CoreSubscriber<? super I> subscribeOrReturn(CoreSubscriber<? super O> actual) throws Throwable; | ||
| public abstract @Nullable CoreSubscriber<? super I> subscribeOrReturn(CoreSubscriber<? super O> actual) throws Throwable; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
OptimizableOperator<O,I>.subscribeOrReturn
|
|
||
| @Nullable | ||
| public abstract CoreSubscriber<? super I> subscribeOrReturn(CoreSubscriber<? super O> actual) throws Throwable; | ||
| public abstract @Nullable CoreSubscriber<? super I> subscribeOrReturn(CoreSubscriber<? super O> actual) throws Throwable; |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
OptimizableOperator<O,I>.subscribeOrReturn
| } | ||
|
|
||
| R accumulatedValue() { | ||
| @Nullable R accumulatedValue() { |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
BaseFluxToMonoOperator<T,R>.accumulatedValue
sdeleuze
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo 2 minor comments and the remark I shared previously on double checking arrays nullability manually as the JSpecifyMode is not yet enabled yet.
| } | ||
|
|
||
| @Override | ||
| public final CoreSubscriber<? super T> subscribeOrReturn(CoreSubscriber<? super T> actual) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the removal of final done on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, final class, redundant marker
| // super.getError() returns null by default and this method would throw NPE in that | ||
| // case, however the parent's contract is to return nullable Throwable | ||
| @Override | ||
| @Nullable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried explicit @NonNull instead of @SuppressWarnings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is actually in the argument passed to scanOrDefault which is required to be non-null, otherwise the method throws. Somehow the contract of that method is that it should not accept null values, yet there is extra verification using Object.requireNonNull in place in the body. This is the only weird use of it that can pass on a null argument. Since the class is deprecated I don't want to spend much more time investigating.
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
The JSR-305-based reactor.util.annotation.* classes have been deprecated in favour of JSpecify annotations.
The build runs NullAway errorprone plugin. Several public APIs have been refined to better reflect the nullability characteristics and also some internal implementations have also been adjusted based on the new compilation warnings.
This PR replaces #4016.