@@ -155,7 +155,7 @@ public SELF withFilter(Filter<C, A> filter) {
155155 return self ();
156156 }
157157
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 ) {
159159 if (this .filter .match (this .callbackType , callbackInstance , this .argument , this .additionalArguments )) {
160160 try {
161161 return InvocationResult .of (supplier .get ());
@@ -245,6 +245,8 @@ private Callback(Class<C> callbackType, C callbackInstance, A argument,
245245 * Invoke the callback instance where the callback method returns void.
246246 * @param invoker the invoker used to invoke the callback
247247 */
248+ // Lambda isn't detected with the correct nullability
249+ @ SuppressWarnings ("NullAway" )
248250 public void invoke (Consumer <C > invoker ) {
249251 invoke (this .callbackInstance , () -> {
250252 invoker .accept (this .callbackInstance );
@@ -259,7 +261,9 @@ public void invoke(Consumer<C> invoker) {
259261 * @return the result of the invocation (may be {@link InvocationResult#noResult}
260262 * if the callback was not invoked)
261263 */
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 ) {
263267 return invoke (this .callbackInstance , () -> invoker .apply (this .callbackInstance ));
264268 }
265269
@@ -285,6 +289,8 @@ private Callbacks(Class<C> callbackType, Collection<? extends C> callbackInstanc
285289 * Invoke the callback instances where the callback method returns void.
286290 * @param invoker the invoker used to invoke the callback
287291 */
292+ // Lambda isn't detected with the correct nullability
293+ @ SuppressWarnings ("NullAway" )
288294 public void invoke (Consumer <C > invoker ) {
289295 this .callbackInstances .forEach ((callbackInstance ) -> invoke (callbackInstance , () -> {
290296 invoker .accept (callbackInstance );
@@ -299,7 +305,9 @@ public void invoke(Consumer<C> invoker) {
299305 * @return the results of the invocation (may be an empty stream if no callbacks
300306 * could be called)
301307 */
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 ) {
303311 Function <C , InvocationResult <R >> mapper = (callbackInstance ) -> invoke (callbackInstance ,
304312 () -> invoker .apply (callbackInstance ));
305313 return this .callbackInstances .stream ()
0 commit comments