src/main/java/ognl/OgnlOps.java
public static RuntimeException castToRuntime(Throwable t)
    {
        if (RuntimeException.class.isInstance(t))
            return (RuntimeException)t;

        if (OgnlException.class.isInstance(t))
            throw new UnsupportedCompilationException("Error evluating expression: " + t.getMessage(), t);
        
        return new RuntimeException(t);
    }
public static RuntimeException castToRuntime(Throwable t)
    {
        if (RuntimeException.class.isInstance(t))
            return (RuntimeException)t;

        if (OgnlException.class.isInstance(t))
            throw new UnsupportedCompilationException("Error evluating expression: " + t.getMessage(), t);
        
        return new RuntimeException(t);
    }
public static RuntimeException castToRuntime ( Throwable t ) { if ( RuntimeException . class . isInstance ( t ) ) return ( RuntimeException ) t ; if ( OgnlException . class . isInstance ( t ) ) throw new UnsupportedCompilationException ( "Error evluating expression: " + t . getMessage ( ) , t ) ; return new RuntimeException ( t ) ; }
Utility method that converts incoming exceptions to {@link RuntimeException}
instances - or casts them if they already are.

@param t
The exception to cast.
@return The exception cast to a {@link RuntimeException}.
Utility method that converts incoming exceptions to { @link RuntimeException } instances - or casts them if they already are .