5 ms·
There's also this magic function: private static <T extends Throwable> T sneakyThrow(Throwable ex) throws T { throw (T) ex; } Due to generic type era
by elFarto 6y ago
There's also this magic function:
private static <T extends Throwable> T sneakyThrow(Throwable ex) throws T {
throw (T) ex;
}
Due to generic type erasure, the entire throw clause gets erased so it looks like this method doesn't throw anything.