APIdia Launch Partner
Top Fields Constructors Methods
jdk.jpackage.internal.util.function

public Class ExceptionBox

extends RuntimeException
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, java.util.Objects, java.util.function.Consumer, java.util.stream.Stream

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Error
public static RuntimeException
public static Exception
public static void
visitUnboxedExceptionsRecursively(Throwable
the exception to visit
t
,
Consumer<Exception>
the callback to apply to every subsequently visited exception
visitor
)

Unboxes the specified throwable and its suppressed throwables recursively.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

ExceptionBoxback to summary
private ExceptionBox(Exception ex)

Method Detail

reachedUnreachableback to summary
public static Error reachedUnreachable()
toUncheckedback to summary
public static RuntimeException toUnchecked(Exception ex)
unboxback to summary
public static Exception unbox(Throwable t)
visitUnboxedExceptionsRecursivelyback to summary
public static void visitUnboxedExceptionsRecursively(Throwable t, Consumer<Exception> visitor)

Unboxes the specified throwable and its suppressed throwables recursively.

Calls unbox(Throwable) on the specified throwable and nested suppressed throwables, passing the result to the visitor.

Throwables will be traversed in the "cause before consequence" order. E.g.: say exception "A" suppresses exceptions "B" and "C", and "B" suppresses "D". The traverse order will be "D", "B", "C", "A".

If the method encounters cyclic suppressed throwables, it will fall into an infinite recursion loop, eventually causing a StackOverflowError.

If the specified throwable or any of its nested suppressed throwables are of type Error, the method will keep notifying the visitor until it hits the first such throwable. When it happens, the method will throw this throwable.

Parameters
t:Throwable

the exception to visit

visitor:Consumer<Exception>

the callback to apply to every subsequently visited exception