Skip to content
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

[BUG] @SneakyThrows throws a compile error #3300

Closed
RoughlyUnderscore opened this issue Nov 17, 2022 · 3 comments
Closed

[BUG] @SneakyThrows throws a compile error #3300

RoughlyUnderscore opened this issue Nov 17, 2022 · 3 comments

Comments

@RoughlyUnderscore
Copy link

Describe the bug
I have recently upgraded my project's Java from 16 to 19. Now, compiling throws an error at a class that has @SneakyThrows - particularly at line 63. Here's my deduction process:

  1. I've been getting an empty error ("X:63" with no elaboration); I've changed that line, then outright deleted it, and it still was happening.
  2. I cleared the class to only have about 50 lines, then it started throwing an error at the 63rd line of another class.
  3. I decided to comment out all the Lombok annotations in both classes and it compiled successfully.
  4. I slowly uncommented all the annotations and it compiled successfully, with the exception of @SneakyThrows - in fact, the only 2 classes that had SneakyThrows were the classes that it would throw compile errors at.
    As such I've come to a conclusion that something is wrong with the SneakyThrows interpretation, and, for some reason, it's all good in Java 16.
    Error: image

To Reproduce
Create a project, make a method, in which something would normally throw errors (like IO operations), annotate it with @SneakyThrows, try to compile the project. Make sure that the class has at least 63 lines, preferably more.

Expected behavior
The compilation should have been successful even with @SneakyThrows.

Version info (please complete the following information):
Lombok:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.24</version>
    <scope>provided</scope>
</dependency>

Javac:
javac 19.0.1.

Additional context
The project is a Spigot plugin.

@YassinHajaj
Copy link
Contributor

Linked to this ?
#3264

@pitzzahh
Copy link

I also encountered the same error with jdk19.

@rzwitserloot
Copy link
Collaborator

Duplicate of #3264

@rzwitserloot rzwitserloot marked this as a duplicate of #3264 Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants