@@ -155,7 +155,7 @@ public SELF withFilter(Filter<C, A> filter) {
155
155
return self ();
156
156
}
157
157
158
- protected final <R > InvocationResult <R > invoke (C callbackInstance , Supplier <R > supplier ) {
158
+ protected final <R > InvocationResult <R > invoke (C callbackInstance , Supplier <@ Nullable R > supplier ) {
159
159
if (this .filter .match (this .callbackType , callbackInstance , this .argument , this .additionalArguments )) {
160
160
try {
161
161
return InvocationResult .of (supplier .get ());
@@ -245,6 +245,8 @@ private Callback(Class<C> callbackType, C callbackInstance, A argument,
245
245
* Invoke the callback instance where the callback method returns void.
246
246
* @param invoker the invoker used to invoke the callback
247
247
*/
248
+ // Lambda isn't detected with the correct nullability
249
+ @ SuppressWarnings ("NullAway" )
248
250
public void invoke (Consumer <C > invoker ) {
249
251
invoke (this .callbackInstance , () -> {
250
252
invoker .accept (this .callbackInstance );
@@ -259,7 +261,9 @@ public void invoke(Consumer<C> invoker) {
259
261
* @return the result of the invocation (may be {@link InvocationResult#noResult}
260
262
* if the callback was not invoked)
261
263
*/
262
- public <R > InvocationResult <R > invokeAnd (Function <C , R > invoker ) {
264
+ // Lambda isn't detected with the correct nullability
265
+ @ SuppressWarnings ("NullAway" )
266
+ public <R > InvocationResult <R > invokeAnd (Function <C , @ Nullable R > invoker ) {
263
267
return invoke (this .callbackInstance , () -> invoker .apply (this .callbackInstance ));
264
268
}
265
269
@@ -285,6 +289,8 @@ private Callbacks(Class<C> callbackType, Collection<? extends C> callbackInstanc
285
289
* Invoke the callback instances where the callback method returns void.
286
290
* @param invoker the invoker used to invoke the callback
287
291
*/
292
+ // Lambda isn't detected with the correct nullability
293
+ @ SuppressWarnings ("NullAway" )
288
294
public void invoke (Consumer <C > invoker ) {
289
295
this .callbackInstances .forEach ((callbackInstance ) -> invoke (callbackInstance , () -> {
290
296
invoker .accept (callbackInstance );
@@ -299,7 +305,9 @@ public void invoke(Consumer<C> invoker) {
299
305
* @return the results of the invocation (may be an empty stream if no callbacks
300
306
* could be called)
301
307
*/
302
- public <R > Stream <R > invokeAnd (Function <C , R > invoker ) {
308
+ // Lambda isn't detected with the correct nullability
309
+ @ SuppressWarnings ("NullAway" )
310
+ public <R > Stream <R > invokeAnd (Function <C , @ Nullable R > invoker ) {
303
311
Function <C , InvocationResult <R >> mapper = (callbackInstance ) -> invoke (callbackInstance ,
304
312
() -> invoker .apply (callbackInstance ));
305
313
return this .callbackInstances .stream ()
0 commit comments