Renaming class with the `Rename Also File With the Declaration` option ends with an error
Apache NetBeans version
Apache NetBeans 15
What happened
When I try to rename the class name and the file, NB first renames the file and then gives me the error "File
How to reproduce
- Create php class
- Try rename class name
- In rename dialog check
Rename Also File With the Declarationoption
Did this work correctly in an earlier version?
Apache NetBeans 14
Operating System
windows 11 pro
JDK
Java: 18.0.1; Java HotSpot(TM) 64-Bit Server VM 18.0.1+10-24
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No
Code of Conduct
Yes
Confirmed still happens. Hard to isolate. Sometimes happens, sometimes not. Mostly for newly created classes, not yet referenced from other files.
The issue dissapears once the "reference" gets created. For example:
$o = new myclass(); $o->some_method();
Then click some_method and use navigate to the declaration. Since then, the myclass file can be refactored without issues.
--
Also after the issue occurs, there still appears the old file (before rename) in the list of files (sorry cannot recall where ATM) but it disappears from the above list after netbeans close-open. The point is, the issue leaves the reference of the old file somewhere until app restart.
I can't reproduce it.
Product Version: Apache NetBeans IDE 20
Java: 19.0.2; OpenJDK 64-Bit Server VM 19.0.2+7-Ubuntu-0ubuntu322.04
Runtime: OpenJDK Runtime Environment 19.0.2+7-Ubuntu-0ubuntu322.04
System: Linux version 6.5.0-17-generic running on amd64; UTF-8;
I can't reproduce it.
Product Version: Apache NetBeans IDE 20 Java: 19.0.2; OpenJDK 64-Bit Server VM 19.0.2+7-Ubuntu-0ubuntu322.04 Runtime: OpenJDK Runtime Environment 19.0.2+7-Ubuntu-0ubuntu322.04 System: Linux version 6.5.0-17-generic running on amd64; UTF-8;
yes, as said before, sometimes happens, sometimes not, not sure but seems to be related to the size of project or number of project files
Product Version: Apache NetBeans IDE 21
Java: 11.0.22; OpenJDK 64-Bit Server VM 11.0.22+7-post-Ubuntu-0ubuntu220.04.1
Runtime: OpenJDK Runtime Environment 11.0.22+7-post-Ubuntu-0ubuntu220.04.1
System: Linux version 5.4.0-173-generic running on amd64; UTF-8; en_US (nb)