This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 190288 - Netbeans incorrectly parses the classpath resulting in incorrect errors getting highlighted in the editor for JUnit tests
Summary: Netbeans incorrectly parses the classpath resulting in incorrect errors getti...
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-10 09:54 UTC by netbeansuzr
Modified: 2010-09-11 12:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description netbeansuzr 2010-09-10 09:54:53 UTC
Hi.  First of all i just want to give a big thank you to the Netbeans development team for making such a great product freely available.  Second i want to apologize if i posted this bug in the wrong category.

Now for the bug information.  I am running NetBeans IDE 6.9.1 (Build 201007282301).

99% of the time when i start netbeans and let it finish the classpath scanning (this also happens if i manually close and re-open the project), netbeans will highlight all sorts of classes and lines of source in the editor (all of which are contained in JUnit tests) indicating that it can't find the source file or method for eg.  However when i run the JUnit test it compiles and passes fine.

Issues when this happens:
-i can't use any tools such as re-factoring, go to source etc because netbeans can't find the classes
-distracting and annoying erroneous error warnings and can't tell which ones are legit and which are fake after i start editing the JUnit test.

The JUnit tests are set up under the JUnit or editing section of the project settings.

I believe i have had times when the JUnit tests were parsed correctly but they are very rare.

This is a really annoying bug that i would really appreciate getting fixed as soon as possible.

Thanks!
Comment 1 Jan Lahoda 2010-09-10 12:26:30 UTC
Sorry, but more information will be needed to find out what is the problem. Most helpful would be a standalone case+steps to reproduce the problem. If that is not possible please provide as much information about you project setup, type classpath, etc as possible. Thanks.
Comment 2 netbeansuzr 2010-09-11 01:11:38 UTC
Hi Thanks for looking into this.  Before i provide more information, i want to ask a side question.  I posted 4 bugs today and only two of them show up when i got to my bugs (i checked the query and the filter is set to show if i am the reporter of the bug).  Do you know how i can view all the bugs i posted easily?

Now to answer your question.  I have a fairly big project so i won't be able to give you a case but i can tell you how my project is set up.  I have a folder structure as noted below (example only):

workingDirectory\App1\build.xml
workingDirectory\App1\run.bat (to run the application standalone)
workingDirectory\App1\classes\** (java sources)
workingDirectory\App2\build.xml
workingDirectory\App2\run.bat (to run the application standalone)
workingDirectory\App2\classes\** (java sources)
workingDirectory\Test\classes\** (all JUnit tests in the same packages as apps, for eg. If i have App1\classes\package1\MainFile.java and i have a test for it, it would be in Test\classes\package1\TestCase.java)

Again, all the test cases are mounted under the test section of the project and all the non test files are mounted in the source section.

Another thing to note is that i have two projects made from the workingDirectory, one mounts all the classes subdirectories of all apps and it is the project i run execution profiles from.  The other mounts the root workingDirectory and excludes all classes directories.  I use this to edit and run my custom build scripts and other files that are above the classes subdirectory.

Also i would like to ask for an enhancement request of not trying to prevent the user from mounting a subdirectory in a separate project for which a parent directory is already mounted.  I have always felt that this was an unnecessary restriction.

I hope that helps.  Thanks again for looking into this.
Comment 3 netbeansuzr 2010-09-11 12:45:51 UTC
I just wanted to update you on my side question about bugzilla.  I was able to get the query to work correct and to show me all the bugs i posted so you don't have to reply to that question, though it seemed to forget the status filter whenever i selected all the statuses in my query.  Then as i would click on older saved searches, it would forget my newer ones that i saved, until i realize i had to reload the page manually for some reason, maybe the status filter being forgotten was a similar issue.

Please let me know if you need more information about this bug.