netbeans
netbeans copied to clipboard
Rename array-typed variable may breaks code
Apache NetBeans version
Apache NetBeans latest daily build
What happened
In case I have two array typed variables and I want rename one of them the second one unexpected changes type and this gives error
How to reproduce
in some java class define two array-typed fields ex...
private String arrayOne[], arrayTwo[];
invoke rename command for first field ex to arrayOneRenamed after rename code changes to
String[] arrayOneRenamed, arrayTwo[];
which is unexpected changes the second field type
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 10
JDK
JDK 18.0.2
Apache NetBeans packaging
Own source build
Anything else
No response
Are you willing to submit a pull request?
No
Code of Conduct
Yes
This issue is a copy of https://issues.apache.org/jira/browse/NETBEANS-4355
Confirmed. First workaround, use inline renaming with CTRL-R
; second workaround, use idiomatic syntax String[]
. :wink: