Files
Tagir Valeevandintellij-monorepo-bot ce18179a78 [java-analysis] Parameter nullability: prefer nullability known from type over nullability known from parameter declaration
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
2024-12-06 14:57:38 +00:00

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);
}
}