Closed SBasalaev closed 1 month ago
any on-save action enabled? Organize imports or formatting etc?
Yes, "Remove unused imports". After disabling it I can save, so this is actually two separate issues.
right, just wanted to make sure this applies here too. The other issue is tracked under #4054.
Is this still a valid issue?
Yes, it's still a valid issue. I get exactly the same stack trace as SBasalaev. NetBeans 18 (binary from zip), Debian Bookworm (12.1), OpenJDK-17 (Debian supplied). LXDE desktop. Peter
i am wondering why issues like this don't show up when javac is ran from CLI. NPEs in javac seem to be more common now. Going to start using the https://github.com/apache/netbeans/labels/nb-javac label for issues like this. The good thing here is that we have a simple reproducer which other filed issues lack.
cc @lahodaj
checked and this is still reproducible with 22-rc1
updated trace since the line numbers moved:
FWIW, I've filled: https://bugs.openjdk.org/browse/JDK-8331212 have a (potential) fix, will open a PR sometime soon.
the nb-javac update https://github.com/apache/netbeans/pull/7484 fixed this and is already testable in NB23rc1. There is no longer an exception and the errors are annotated as expected:
closing
Apache NetBeans version
Apache NetBeans 16
What happened
When I add a case with a block to the switch expression, exception notification appears and completion stops working. If I try to save a file after that the whole application freezes.
How to reproduce
Suppose I have a class (requires JDK 17 with preview features enabled)
Then I start adding a new case. The issue happens right after I type the opening brace
Creating file with that contents does not always cause the issue but typing the line in editor always does. This also happened in previous versions of NetBeans and with previous JDK versions.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Ubuntu Linux 22.04 amd64
JDK
OpenJDK 19 (system provided)
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
Stack trace reported by NetBeans
Are you willing to submit a pull request?
No
Code of Conduct
Yes