Java SneakyThrow of exceptions, type erasure

If you compile it with -Xlint you’ll get a warning: c:\Users\Jon\Test>javac -Xlint SneakyThrow.java SneakyThrow.java:9: warning: [unchecked] unchecked cast throw (T) ex; ^ required: T found: Throwable where T is a type-variable: T extends Throwable declared in method <T>sneakyThrowInner(Throwable) 1 warning That’s basically saying “This cast isn’t really checked at execution time” (due to type erasure) … Read more