Package com.arjuna.ats.jta.cdi
Class SneakyThrow
java.lang.Object
com.arjuna.ats.jta.cdi.SneakyThrow
An utility class which makes possible to throw any exception as a
RuntimeException.
It means to throw checked exception (subtype of Throwable or Exception) as un-checked exception.
This considers the Java 8 inference rule that states that a throws E is inferred as RuntimeException.-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Throwable>
voidThis method can be used inthrowstatement such as:throw sneakyThrow(exception);.
-
Method Details
-
sneakyThrow
This method can be used inthrowstatement such as:throw sneakyThrow(exception);.- Throws:
E
-