All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.weld.invokable.SneakyThrow Maven / Gradle / Ivy

package org.jboss.weld.invokable;

class SneakyThrow {
    private SneakyThrow() {
    }

    /**
     * This method can and should be used as part of a {@code throw} statement,
     * such as: {@code throw sneakyThrow(exception);}. It is guaranteed to never return normally,
     * and this style of usage makes sure that the Java compiler is aware of that.
     */
    @SuppressWarnings("unchecked")
    static  RuntimeException sneakyThrow(Throwable e) throws E {
        throw (E) e;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy