Skip to content

Commit

Permalink
Add @nullable annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsamehsalah committed May 31, 2023
1 parent fc4bc6f commit d46216f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.sun.source.tree.MethodInvocationTree;
import com.sun.tools.javac.code.Type;
import java.util.function.Function;
import org.jspecify.annotations.Nullable;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;

Expand Down Expand Up @@ -62,7 +63,7 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState
}

private static boolean isNestedPublisher(
VisitorState state, Type publisherOfPublisherType, Type treeType) {
VisitorState state, @Nullable Type publisherOfPublisherType, Type treeType) {
return publisherOfPublisherType != null
&& state.getTypes().isSubtype(treeType, publisherOfPublisherType);
}
Expand All @@ -72,7 +73,7 @@ private static boolean isNestedPublisher(
* Flux#groupBy(Function)}.
*/
private static boolean isTypeArgumentGroupedFlux(
VisitorState state, Type groupedFluxType, Type treeType) {
VisitorState state, @Nullable Type groupedFluxType, Type treeType) {
return groupedFluxType != null
&& treeType.getTypeArguments().stream()
.anyMatch(typez -> ASTHelpers.isSameType(typez, groupedFluxType, state));
Expand Down

0 comments on commit d46216f

Please sign in to comment.