mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
Separate write-nullability and read-nullability GitOrigin-RevId: 54d1b3509f99732466feba2b3932cf334d1ed086
28 lines
841 B
Java
28 lines
841 B
Java
import org.jspecify.annotations.NullMarked;
|
|
import org.jspecify.annotations.NullUnmarked;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
@NullMarked
|
|
class SuperTypeVariable {
|
|
<T extends @Nullable Object> void nullableBounded(
|
|
Lib<? super T> lib, T t, @Nullable T tUnionNull) {
|
|
lib.useT(<warning descr="Argument 'tUnionNull' might be null">tUnionNull</warning>);
|
|
|
|
lib.useT(t);
|
|
}
|
|
<T> void implicitlyObjectBounded(
|
|
Lib<? super T> lib, T t, @Nullable T tUnionNull) {
|
|
lib.useT(<warning descr="Argument 'tUnionNull' might be null">tUnionNull</warning>);
|
|
|
|
lib.useT(t);
|
|
}
|
|
<T> void noSuper(
|
|
Lib<T> lib, T t, @Nullable T tUnionNull) {
|
|
lib.useT(<warning descr="Argument 'tUnionNull' might be null">tUnionNull</warning>);
|
|
|
|
lib.useT(t);
|
|
}
|
|
interface Lib<T extends @Nullable Object> {
|
|
void useT(T t);
|
|
}
|
|
} |