errael opened a new issue, #9514:
URL: https://github.com/apache/netbeans/issues/9514
### Apache NetBeans version
Apache NetBeans 31 latest release candidate
### What happened
At `Tools > Editor > OnSave > Java`
- Uncheck `Remove unused Imports`
- Check `Organize Imports`
- Apply
- Save the following (note ArrayList is commented out)
Observe
`import java.util.ArrayList;` is removed even though `Remove Unused
Imports` is unchecked.
```
package com.raelity.play;
import java.util.ArrayList;
import java.util.LinkedList;
public class DontRemoveUnusedImportOnSave
{
// ArrayList<Object> l1;
LinkedList<Object> l2;
}
```
### Language / Project Type / NetBeans Component
java/OnSave (hints?/options?)
### How to reproduce
See OP.
If this behavior is what's wanted (it's not what I want), then in the UI
when `Organize Imports` is checked, `Remove Unused Imports` should be both
checked and disabled automatically.
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Linux harmony 7.0.9-76070009-generic #202605191504~1779464622~22.04~ef31795
SMP PREEMPT_DYNAMIC Fri M 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
_No response_
### 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