JoachimRohde opened a new issue, #7964: URL: https://github.com/apache/netbeans/issues/7964
### Apache NetBeans version Apache NetBeans 24 release candidate ### What happened In the following code the first comment line gets deleted when CTRL+SHIFT+I is pressed to fix imports: ``` package com.mycompany.fiximportdeletescommentdemo; import java.util.List; // https://github.com/toby1984/swing-autocomplete // xxx // https://github.com/toby1984/swing-autocomplete/blob/master/src/test/java/de/codesourcery/swing/autocomplete/Demo.java public class FixImportDeletesCommentDemo { public static void main(String[] args) { System.out.println("Hello World!"); } } ``` I could reproduce this behaviour with NetBeans 22 and NetBeans 24-rc3. It only occurs if all imports are about to be removed and the code does not contain any unresolved imports. If those criterias are met the issue is always reproduceable. A trivial Maven project to demonstrate this issue: [FixImportDeletesCommentDemo.zip](https://github.com/user-attachments/files/17748376/FixImportDeletesCommentDemo.zip) ### Language / Project Type / NetBeans Component Java editor ### How to reproduce See text above and attached project. ### Did this work correctly in an earlier version? No / Don't know ### Operating System Linux Mint 21.3 Cinnamon ### JDK 17.0.12; OpenJDK 64-Bit Server VM 17.0.12+7-Ubuntu-1ubuntu222.04 ### 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
