Skip to content

Commit b63e0e2

Browse files
authored
Add passing test. (#7063)
1 parent d6b001e commit b63e0e2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

checker/tests/nullness/Issue6671.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package open.falsepos;
2+
3+
// Use the Nullness Checker
4+
public interface Issue6671<E extends Exception> {
5+
Object _apply(Object t) throws E;
6+
7+
default Object apply(Object t) {
8+
try {
9+
return _apply(t);
10+
} catch (Exception e) {
11+
sneakyThrow(e);
12+
throw new RuntimeException(e);
13+
}
14+
}
15+
16+
@SuppressWarnings("unchecked")
17+
private static <T extends Throwable> void sneakyThrow(final Throwable x) throws T {
18+
throw (T) x;
19+
}
20+
}

0 commit comments

Comments
 (0)