I am looking for a way to declare the nullability of a return value depending on nullability of one (or possibly more) input values. This is an example from commons-lang3 StringUtils:
public static String join(final boolean[] array, final char delimiter) {
if (array == null) {
return null;
}
return join(array, delimiter, 0, array.length);
}
In the light of #2783 also this is of interest: https://github.com/jspecify/jspecify/issues/79 IOW: if Jspecify would agree on @PolyNull then this would be a strong reason for ecj to follow suit.
This is a follow-up issue to https://bugs.eclipse.org/bugs/show_bug.cgi?id=575822
I am looking for a way to declare the nullability of a return value depending on nullability of one (or possibly more) input values. This is an example from commons-lang3 StringUtils:
As suggested in https://bugs.eclipse.org/bugs/show_bug.cgi?id=575822, it would be great to make it work by being able to specify something like:
This would also be great for the java.util.Optional class:
when one could specify these EEAs: