public final void setUncheckedLocalException ( Throwable ex ) throws EJBException { ExceptionMappingStrategy exceptionStrategy = getExceptionMappingStrategy ( ) ; Throwable mappedException = exceptionStrategy . setUncheckedException ( this , ex ) ; if ( mappedException != null ) { if ( mappedException instanceof EJBException ) { throw ( EJBException ) mappedException ; } else if ( mappedException instanceof RuntimeException ) { throw ( RuntimeException ) mappedException ; } else if ( mappedException instanceof Error ) { throw ( Error ) mappedException ; } else { // Unless there is a defect in mapping strategy, this should // never happen. But if it does, we are going to // wrap what is returned with a EJBException. This is added // measure to ensure we do not break applications that // existed prior to EJB 3. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "unexpected Throwable returned by exception mapping strategy" , new Object [ ] { mappedException , exceptionStrategy } ) ; } throw ExceptionUtil . EJBException ( mappedException ) ; } } }
d395666 - rewrote entire method .