-
Bug
-
Resolution: Fixed
-
P4
-
11, 12
-
b09
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8229877 | 11.0.6-oracle | Sean Coffey | P4 | Resolved | Fixed | b01 |
JDK-8233973 | 11.0.6 | Weijun Wang | P4 | Resolved | Fixed | b04 |
JDK-8290755 | openjdk8u352 | Andrew Hughes | P4 | Resolved | Fixed | b01 |
JDK-8290721 | openjdk8u342 | Andrew Hughes | P4 | Resolved | Fixed | b07 |
test/lib/jdk/test/lib/Utils.java
public static void runAndCheckException(Runnable runnable, Consumer<Throwable> checkException) {
try {
runnable.run();
checkException.accept(null);
} catch (Throwable t) {
checkException.accept(t);
}
}
Suppose checkException.accept(null) throws a Throwable itself it will be caught and accepted again.
Also, since this method is mainly used to check for exceptions thrown by runnable, it's better to use ThrowingRunnable (defined in the same source file) than Runnable.
public static void runAndCheckException(Runnable runnable, Consumer<Throwable> checkException) {
try {
runnable.run();
checkException.accept(null);
} catch (Throwable t) {
checkException.accept(t);
}
}
Suppose checkException.accept(null) throws a Throwable itself it will be caught and accepted again.
Also, since this method is mainly used to check for exceptions thrown by runnable, it's better to use ThrowingRunnable (defined in the same source file) than Runnable.
- backported by
-
JDK-8229877 jdk.test.lib.Utils::runAndCheckException error
-
- Resolved
-
-
JDK-8233973 jdk.test.lib.Utils::runAndCheckException error
-
- Resolved
-
-
JDK-8290721 jdk.test.lib.Utils::runAndCheckException error
-
- Resolved
-
-
JDK-8290755 jdk.test.lib.Utils::runAndCheckException error
-
- Resolved
-