mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:08:51 +07:00
26 lines
544 B
Java
26 lines
544 B
Java
// "Surround with try/catch" "true-preview"
|
|
public class ExTest {
|
|
public static void maybeThrow(String data) throws Ex {
|
|
throw new Ex(data);
|
|
}
|
|
|
|
{
|
|
Block<String> b = (t) -> {
|
|
try {
|
|
return ExTest.maybeThrow(t);
|
|
} catch (Ex e) {
|
|
<selection>throw new RuntimeException(e);</selection>
|
|
}
|
|
};
|
|
}
|
|
|
|
|
|
private static class Ex extends Throwable {
|
|
public Ex(String s) {
|
|
}
|
|
}
|
|
}
|
|
|
|
interface Block<T> {
|
|
public void accept(T t);
|
|
} |