Getting Rid of Checked Exceptions in Java

So, you’re tired of rethrowing checked Exceptions that you can’t handle? Did you wish a long time ago IOException and SQLException were in fact RuntimeExceptions (as they should be according to Sun’s own definition)? The pain was there but it got kind of dull over the years? Acceptance of the inevitable and all that. How about this:

    @SneakyThrows
    public void doSomething() { 
        throw new Exception();
    }

Did I hear a “WTF”? Say hello to project Lombok.

IBM developerWorks has a great article to get you started with your own custom AST transformations.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: