mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 14:50:53 +07:00
25 lines
462 B
Java
25 lines
462 B
Java
// "Replace with lambda" "true-preview"
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
class A {
|
|
|
|
public <T> T runReadAction( final Supplier<T> computation) {
|
|
|
|
return null;
|
|
}
|
|
|
|
|
|
public <T, E extends Throwable> T runReadAction( ThrowableComputable<T, E> computation) throws E {
|
|
return null;
|
|
}
|
|
|
|
{
|
|
runReadAction((Supplier<String>) () -> "");
|
|
}
|
|
}
|
|
|
|
@FunctionalInterface
|
|
interface ThrowableComputable<T, E extends Throwable> {
|
|
T compute() throws E;
|
|
} |