News for hackers. Stuff that matters.
Re:Java’s Checked Exceptions Are Evil? (2015) by usrusr on Sunday September 23, 2018 @10:09AM (#18051135)
That whole discussion would not exist if java had a convenience syntax for rethrowing checked exceptions wrapped in a RuntimeException, in less than the customary four extra lines.

Some kind of call-site use of the throws keyword perhaps?

byte[] bytes = "Example".getBytes("UTF-8") throws RuntimeException;

I can't really think of a reasonable use case for anything other than RuntimeException, but in the old days, some people would surely have loved to rethrow wrapped as MyCompanyException.

Re:Java’s Checked Exceptions Are Evil? (2015) by bunderbunder on Sunday September 23, 2018 @10:14AM (#18051151)
It's fairly easy to get something like this with Java 8. I have my own set of wrapper functions that let me do something like:

  byte[] bytes = unchecked(() -> "Example".getBytes("UTF-8"));