mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 08:50:57 +07:00
30 lines
543 B
Java
30 lines
543 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(new Suppl<caret>ier<String>() {
|
|
@Override
|
|
public String get() {
|
|
return "";
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
@FunctionalInterface
|
|
interface ThrowableComputable<T, E extends Throwable> {
|
|
T compute() throws E;
|
|
} |