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

   ### Apache NetBeans version
   
   Apache NetBeans 17
   
   ### What happened
   
   Hello
   
   This is an issue that I have experienced in all Netbeans Versions since ~12 
but has gotten better with 17, still, it appears from time to time. So:
   
   From time to time, in some of my Maven projects, it happens that Unit Tests 
do not find a class in the same package anymore. They show up marked as "red" 
and lines using them show up as "red" saying "missing symbol" and when running 
them via the IDE with the individual-file context menu fail with errors such as:
   ```
   java.lang.RuntimeException
   Uncompilable code - cannot find symbol
     symbol: variable MyClass
     location: class com.xyz.MyClassTest
   at com.xyz.MyClassTest.test(MyClassTest.java:1)
   ```
   Where MyClass is in the same package as the MyClassTest (com.xyz).
   
   When I run the same test via the more high-level "maven clean build" 
commands all works fine (in the IDE and also from the command line).
   
   Change the Java Version does not help. Recompiling does not help. Restarting 
the IDE does not help.  Change Maven Version or bundled vs external does not 
help.
   
   The only thing to make this go away is go to the cache directory and remove 
the index directory (shutting down the IDE first and then starting again). Once 
I do this, it usually stays fine for a few days or weeks, and then randomly 
appears again. Also, it does not appear for all classes for that package or 
project, it is really quite random.
   
   Any idea how to fix this? I'm also happy to enable debugging/logging and 
help reproduce this.
   
   If it can't be fixed (soon), as a workaround, would it be possible to 
introduce a feature to purge/clean/rebuild the cache/index directory from 
inside of the IDE for specific classes/packages/projects?
   
   Thanks, regards, Leo
   
   ### How to reproduce
   
   I cannot hard-reproduce the problem.
   
   I believe it happens more often the more "load" is on the IDE. So, if I only 
have one or two projects open in the IDE and they are not big the probability 
for this to happen is low.
   
   But if I have more projects (say, 10-15 each with 100K lines of code) open 
and work on one of them, then it happens more frequently (say, once or twice 
per week).
   
   Also to add, when I do a git checkout/switch from "underneath" the IDE via 
the command line I have the impression that the likelyhood for this to happen 
is increased - but I have also seen it happen just out of the blue by editing a 
class from the IDE.
   
   Also, I think this was worse in previous versions of the IDE, it improved 
with Netbeans 17.
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 12.6 or earlier
   
   ### Operating System
   
   Windows 10
   
   ### JDK
   
   8, 11, 17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   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