SneakyThrows without parameters should default to Throwable.class #146

Closed
lombokissues opened this Issue Jul 14, 2015 · 5 comments

Projects

None yet

1 participant

@lombokissues
Collaborator

Migrated from Google Code (issue 73)

@lombokissues
Collaborator

๐Ÿ‘ค r.spilker ย  ๐Ÿ•— Dec 01, 2009 at 22:48 UTC

What steps will reproduce the problem?

  1. Write the following code
    class Test {
    @ SneakyThrows void test() {
    throw new Exception();
    }
    }
  2. Compile with java -cp lombok.jar Test.java

What is the expected output? What do you see instead?
I expected it to compile. Instead I get a compiler error:

Test.java:3: unreported exception java.lang.Exception; must be caught or
declared to be thrown
throw new Exception();
^
1 error

@lombokissues
Collaborator

๐Ÿ‘ค r.spilker ย  ๐Ÿ•— Dec 02, 2009 at 00:33 UTC

It seems to be a javac-only problem. On Eclipse this works as expected.

@lombokissues
Collaborator

๐Ÿ‘ค r.spilker ย  ๐Ÿ•— Dec 02, 2009 at 01:01 UTC

Fixed in 1f4fb2f Will be delivered in 0.9.2 release.

@lombokissues lombokissues added the javac label Jul 14, 2015
@lombokissues
Collaborator

๐Ÿ‘ค reinierz ย  ๐Ÿ•— Feb 07, 2011 at 21:34 UTC

@lombokissues
Collaborator

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment