errael opened a new issue, #4724:
URL: https://github.com/apache/netbeans/issues/4724
### Apache NetBeans version
Apache NetBeans latest daily build
### What happened
Refactor field name in record declaration, got syntax error in file. Similar
situation produces an NPE, see below.
### How to reproduce
In the following source code, with the caret on the field named `string` in
the record `ClipData, refactor rename. The field name gets changed where it's
referenced, but not in the record declaration.
```
public class Library {
public void someLibraryMethod() {
int type;
String stringData;
var clipData = getClipData();
type = clipData.type;
stringData = clipData.string; /////// this gets changed to stringData
}
//////////////////////////////////// VVVVVV ///// refactor this to stringData
record ClipData(int type, String string) {}
private ClipData getClipData() {
return new ClipData(3, "foo");
}
}
```
Interestingly, if the field reference is the function, like
```
stringData = clipData.string()
```
Then nothing is changed, the refactor fails, but the file is not left with a
syntax error.
If the caret is on `string()` then there is an NPE.
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Linux harmony 5.19.0-76051900-generic #202207312230~1660780566~22.04~9d60db1
### JDK
openjdk version "11.0.2" 2019-01-15
### Apache NetBeans packaging
Own source build
### Anything else
_No response_
### Are you willing to submit a pull request?
No
### Code of Conduct
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists