mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 07:57:19 +07:00
Type nullability could be more precise if parameter is generic Fixes IDEA-364343 False-positive NPE at unboxing inside lambda with JSpecify annotations GitOrigin-RevId: 9a49f5687eccaa013e639cdf15950be911e100bc
21 lines
573 B
Java
21 lines
573 B
Java
import org.jspecify.annotations.NullMarked;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
// IDEA-364343
|
|
@NullMarked
|
|
class AnotherActivity {
|
|
public interface ThrowingFunction<T1 extends @Nullable Object, T2 extends @Nullable Object> {
|
|
T2 apply(T1 input) throws Throwable;
|
|
}
|
|
|
|
abstract static class Decoder<T extends @Nullable Object> {
|
|
abstract <T2 extends @Nullable Object> Decoder<T2> then(
|
|
ThrowingFunction<? super T, ? extends T2> dataTransform);
|
|
}
|
|
|
|
native Decoder<Boolean> foo();
|
|
|
|
Decoder<Boolean> doWork() {
|
|
return foo().then(f -> !f);
|
|
}
|
|
} |