errael opened a new issue, #9376:
URL: https://github.com/apache/netbeans/issues/9376
### Apache NetBeans version
Apache NetBeans 30 latest release candidate
### What happened
Exception during refactor rename.
### Language / Project Type / NetBeans Component
Refactor rename in java source
### How to reproduce
1. Position the caret on `comp` in `for (Comp comp : some_list)`
2. Select `Menu > Refactor > Rename ...`
3. change comp to xxx (or anythgin)
4. <ENTER>
Observe exception
```
package com.raelity.play.refactor_switch;
import java.util.List;
import javax.swing.JLabel;
public class Refactor_switch {
enum CompDim { H1 }
private record Comp(JLabel label, CompDim dim){};
private List<Comp> some_list = null;
public static void main(String[] args) {
}
public void buildGui_dim()
{
for (Comp comp : some_list) { // REFACTOR RENAME comp GETS EXCEPTION
comp.label.setPreferredSize( switch (comp.dim) {
default -> null;
});
}
}
}
```
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Linux harmony 6.17.9-76061709-generic #202511241048~1764704751~22.04~b24b425
SMP PREEMPT_DYNAMIC Tue D x86_64 x86_64 x86_64 GNU/Linux
### JDK
openjdk 26 2026-03-17 OpenJDK Runtime Environment (build 26+35-2893) OpenJDK
64-Bit Server VM (build 26+35-2893, mixed mode, sharing)
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
Happens every time.
### Are you willing to submit a pull request?
No
--
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