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.
Using Netbeans, I find something quite interesting: I am tring to using part of the java package source code from the other project, say using package a & b's source code from project 1 in project 2. I first copied package a's source code dir into project 2, the Netbeans will quickly report some errors as there is some dependency from package a to package b. Realizing this, I then copy package b's source code dir into project 2 and then expect the disappearance of the previous error messages. I wait and wait and wait, but the error message still there, not willing to leave. What's wrong with this? I begin to doubt the IDE doesn't get aware that I've already copied the required source code there. I then just add a blank line into the source code where the error message hanging and then remove the newly added line, and then all the error message go away! I tried other similar cases, like class A use a function B.abc() while typo it as B.abb(). I then go to class B, modifying the function abc() into abb(). Guess what, the error message still there. I can not drive out the error messages until I insert a blank line and remove the added line. To make a summary of these problems: Netbeans can not get aware of the relevant code changes timely in certain cases and thus can not update the error/warning messages accordingly. Or, the awareness can only be triggered when the developers do some changes to the source code. This will really confuse the developers! I see this a great deficiency in Netbeans. The IDE should really be intelligent enough to aware the context source code changes and update the error/warning message accordingly. Otherwise, it'll misguide the developers, cost the developers too much energy and time to find that there is nothing wrong with his/her code, but the IDE is wrong. Such kind of confusion should really be avoided!
You are right it really works this way. And it should be enhanced. But not P1 - it's the way how it works since error underlines were introduced. I admint that it's annoying, but I personally got used to it - and it's not good :-) I'd suggest to keep *opened file* uptodate, it means to do periodical check even if there were no change in the file, but just for the one opened file, and also for any file that gets focused in editor. It cannot be that expensive.
Milo and others: I have recently written a one-pager for this (used internally for planning of features) - NbFeature1067. I agree with Milan that current behaviour is "as designed", so strictly speaking it's not a DEFECT but it seriously needs to be improved.
It should be a java module issue (java module creates error annotation, editor just paints it), reassigning.
I previously used Eclipse. They have already provide such intelligent awareness capability. I suggest we just look at their source code and see what's their solution.
I think that the check should also apply when there are compilation errors in currently opened file. Because not every compilation error has to be fixed by editing of the file with error in source editor. Another possible fixes are: fixing another file, adding missing library, changing source level, etc.
This is a known issue - setting as duplicate, leaving the original issue as P3, since it is really more an enhancement. Fixing it at this point would have significant performance implications. *** This issue has been marked as a duplicate of 32882 ***