-
Notifications
You must be signed in to change notification settings - Fork 423
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
Throwable.addSuppressed() called by extension, causing IllegalArgumentException #3138
Comments
We are seeing this too with OpenJDK 11.0.18. |
I am getting the same error on openjdk@17 while throwing exception from try-with resource block on macos. "IllegalArgumentException: Self-suppression not permitted" The same test when ran with Gradle test produces expected and accurate results. This is a major bug please fix it ASAP. |
This is an upstream jdt.core issue. |
Related issues: - redhat-developer/vscode-java#3138 - eclipse-jdt/eclipse.jdt.core#934 Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
Related issues: - redhat-developer/vscode-java#3138 - eclipse-jdt/eclipse.jdt.core#934 Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
@snjeza just to let you know this issue still pertains however for my work purposes I have reverted to 1.18 and that works fine for me. You might want to look into it. |
@alimoullim91 You can try VS Code |
The extension is calling java.base/java.lang.Throwable.addSuppressed() on all thrown exceptions when in a try (resource) catch block, causing it to throw an IllegalArgumentException, as you cannot use addSuppressed() on yourself.
This then results in the try-catch block not catching its defined exceptions.
This does not seem to be the case on version 1.18.0 of the extension.
Also when compiled and run through the command line, it does not happen.
Environment
Steps To Reproduce
Run the code:
Current Result
Prints:
Expected Result
Should print:
Additional Informations
Running from the command line instead of the extension, will give the desired result:
Prints:
The text was updated successfully, but these errors were encountered: