New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SneakyThrows without parameters should default to Throwable.class #146

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

Comments

Projects
None yet
1 participant
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 73)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 r.spilker   🕗 Dec 02, 2009 at 00:33 UTC

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

Collaborator

lombokissues commented Jul 14, 2015

👤 r.spilker   🕗 Dec 02, 2009 at 00:33 UTC

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 r.spilker   🕗 Dec 02, 2009 at 01:01 UTC

Fixed in 1f4fb2f Will be delivered in 0.9.2 release.

Collaborator

lombokissues commented Jul 14, 2015

👤 r.spilker   🕗 Dec 02, 2009 at 01:01 UTC

Fixed in 1f4fb2f Will be delivered in 0.9.2 release.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Feb 07, 2011 at 21:34 UTC

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Feb 07, 2011 at 21:34 UTC

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

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