Use jOOλ’s Sneaky Throw to Avoid Checked Exceptions

Don't you hate how you have to wrap checked exception throwing code in static initialisers? E.g. you cannot write this in Java: public class Test { static final Class<?> klass = Class.forName("org.h2.Driver"); } There's an unhandled ClassNotFoundException, and you can't catch / rethrow it simply. A static initialiser is needed: public class Test { static … Continue reading Use jOOλ’s Sneaky Throw to Avoid Checked Exceptions