Specify nullness for some `graphql.schema.idl` classes by mk868 · Pull Request #3895 · graphql-java/graphql-java

I think method parameters in the Assert class should be annotated with @Nullable. We have a similar use case in Spring Framework with our own Assert class. As you can see there, we have annotated this method with a custom @Contract annotation that JSpecify can support if you declare that annotation in the build plugin.

Without that, null safety checks will fail because those method arguments are nullable by nature. The contract annotation lets JSpecify know that once it's checked, it cannot be null.

One last piece of feedback: adding @NullMarked at the class level might turn out to be a bit cumbersome in the long run. You can use that annotation at the package-info level in order to mark the entire package as @NullMarked. From my experience, this scales much better.