Skip to content

Instantly share code, notes, and snippets.

package test;
import org.jetbrains.annotations.NotNull;
public class Test {
public static void main(String[] args) {
notNull(null);
}
private static void notNull(@NotNull String arg) {
package test;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
public class Simple {
public String testMethod(int a, @NotNull String v, @Nullable String b) {
return null;
}
}
package test;
public class Simple {
public String testMethod(int a, String v, String b) {
if (v == null) {
throw new IllegalArgumentException("Argument 1 for @NotNull parameter of test/Simple.testMethod must not be null");
}
return null;
}
}