jirkabs opened a new issue, #4553:
URL: https://github.com/apache/netbeans/issues/4553

   ### Apache NetBeans version
   
   Apache NetBeans 14
   
   ### What happened
   
   The function "Organize imports" adds imports for records from same package. 
The same behavior occurs on file save if "Organize imports on save" is enabled.
   
   Example:
   ```
   package demo;
   
   import demo.RecordA;
   import demo.RecordC;
   import demo.sub.ClassD;
   
   public class App {
   
       RecordA rA;
       RecordC rC;
       private ClassD cD;
   
   }
   ```
   The first two imports are needless and NB also shows hint "Import From The 
Same Package" on that rows.
   
   ### How to reproduce
   
   The problem only occurs if there exists another import (not matter if class 
or record). If the `ClassD` was removed in example then "Organize imports" 
would not add any imports from same package.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Linux, Ubuntu
   
   ### JDK
   
   17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### 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

Reply via email to