public static void fireDeclaredRootCause ( Throwable t , Class ... declaredTypes ) { Throwable root = t ; while ( root != null ) { Throwable cause = root . getCause ( ) ; if ( cause == null ) { break ; } root = cause ; } fireDeclared ( root , declaredTypes ) ; }
Throws the root cause of the given exception if it is unchecked or an instance of any of the given declared types . Otherwise it is thrown as an UndeclaredThrowableException . If the root cause is null then the original exception is thrown . This method only returns normally if the exception is null .