try with resources formatting adding extra space
See original GitHub issueApache NetBeans version
Apache NetBeans 13
What happened
try with resources formatting adds an extra space after the opening parens.
try ( InputStream is = new FileInputStream("foo")) {
^
Unfortunately, we use checkstyle and this causes a rule violation and we use format on save.
How to reproduce
Type the following and format
try (InputStream is = new FileInputStream("foo")) { }
Did this work correctly in an earlier version?
Apache NetBeans 12.6
Operating System
Windows 10
JDK
Eclipse temurin jdk-17.0.0.35-hotspot
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
This has been plaguing people on and off for several old versions. It used to be related to the nb-javac plugin but I have tried with/without/activated/deactivated and it doesn’t seem to make a difference, it keeps adding the extra space.
Some previous issues: https://issues.apache.org/jira/browse/NETBEANS-236 https://issues.apache.org/jira/browse/NETBEANS-4641 https://issues.apache.org/jira/browse/NETBEANS-4676 https://issues.apache.org/jira/browse/NETBEANS-6129 https://issues.apache.org/jira/browse/NETBEANS-6400
Are you willing to submit a pull request?
No
Code of Conduct
Yes
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:14 (5 by maintainers)
Putting a milestone on this, and will take a look ASAP. Be good to get this fixed in NB16 - annoying a lot of people, myself included.
I’ve installed Netbeans 14 (without importing settings from previous versions). This problem is still in.