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 109900 - Spurious error marks on Java files in project view
Summary: Spurious error marks on Java files in project view
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 112735 116316 (view as bug list)
Depends on:
Blocks: 121950
  Show dependency tree
 
Reported: 2007-07-16 20:54 UTC by _ pcw
Modified: 2008-02-21 13:06 UTC (History)
3 users (show)

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 _ pcw 2007-07-16 20:54:45 UTC
Quite often, but with no obvious way to predict or clear steps to reproduce, the IDE will show error glyphs on java
files that have no errors.  The latest case was with a new IDE build, new userdir, and just opening an existing project.

In this latest case, I found that opening a file with an error mark did not remove the mark, but that opening a second
file caused the mark on the first file to go away.  Repeat N+1 times to remove marks from N files.  However, this has
not always worked.

I have also seen spurious error marks on folders when no files therein contained errors.  These are virtually impossible
to get rid of.

Jesse made the following suggestion to help track this down:
> This happens to me frequently. I do not know the cause nor how to reproduce. I would strongly suggest that the
> java/source module explicitly check for the scenario that an error mark on a file is removed without any edits having
> been made, and send some details to the log file so it is possible to fix this. Feel free to file a bug report and add
> me to CC, even though it be unreproducible so far.
Comment 1 Jan Lahoda 2007-07-18 10:55:57 UTC
Unfortunately, at the time the file is opened in the editor and it is detected that there are incorrect errors in the
cache, it is too late to get a usable log (because the problem occurred during caches creation/update).
Comment 2 Jan Lahoda 2007-08-17 14:26:57 UTC
*** Issue 112735 has been marked as a duplicate of this issue. ***
Comment 3 Jesse Glick 2007-10-01 16:38:39 UTC
*** Issue 116316 has been marked as a duplicate of this issue. ***
Comment 4 Jesse Glick 2007-10-02 23:02:25 UTC
I might have a reproducible test case here. Use the script in issue #104508 to make a big source tree, then make a
j2seproject from existing sources from it (use src/ and add lib/*.jar to CP). Open
org.netbeans.api.autoupdate.UpdateUnit and add an arg 'boolean x' to getCodeName(); save. After a few seconds you should
see some error badges as expected. Now delete the arg and save. Most of the badges go away - but not that on
org.netbeans.modules.autoupdate.ui.UnitDetails. Open that file in the editor; it has a badge on the tab, but green box
inside. Close it and the badges go away.
Comment 5 Jan Lahoda 2007-10-03 10:18:59 UTC
Thanks Jesse for test case. This particular case should be fixed by commit below:

Checking in SourceAnalyser.java;
/cvs/java/source/src/org/netbeans/modules/java/source/usages/SourceAnalyser.java,v  <--  SourceAnalyser.java
new revision: 1.16; previous revision: 1.15
done
Comment 6 Jesse Glick 2007-11-02 16:26:25 UTC
New test case for you, found in 071101, JDK 6, Ubuntu.

1. With full NB source tree, build all, but delete nbbuild/netbeans/testtools.

2. Open NB and open nbbuild project.

3. Error badge will appear on project root node. Expand root node. Neither "Ant Tasks" nor "Tests for Ant Tasks" show
any error badge (why?), but org.netbeans.nbbuild under tests does, and many sources show error badges there.

4. Open ArchQuestionsTest.java and CheckLicenseTest.java, the first two sources with errors. Both show error annotations
on usages of NbTestCase.

5. From a shell, ant -f xtest/nbjunit/build.xml and wait for it to finish.

6. Switch back to IDE. The two open sources become OK - annotations removed, badge removed from editor tab, badge
removed from Projects tab. But other files still marked with error badge.

7. Open CheckLinksTest.java. No error annotations (green box), but error badge on editor, and in Projects tab.

8. Open ConvertImportTest.java. Same as step 7, but now error badge disappears from both places on CheckLinksTest.java!

9. Switch tabs back to CheckLinksTest.java and then back again to ConvertImportTest.java. Now the error badge disappears
from ConvertImportTest.java.
Comment 7 Jiri Prox 2007-11-14 23:13:20 UTC
Is this still valid in RC1?
Comment 8 Jesse Glick 2007-11-15 04:28:37 UTC
The test case I described on Nov 02 is still broken and easily reproduced. It is not clear to me if that belongs here,
or in issue #102290.
Comment 9 Jan Lahoda 2008-02-21 13:06:42 UTC
The cause Jesse's last case is that the event that the nbjunit classpath root was created never arrived. The two
changesets ensure that the creation/modification/deletion events for classpath roots are always generated (by use of
FileChangeSupport).

http://hg.netbeans.org/main?cmd=changeset;node=c132a3995ece
http://hg.netbeans.org/main/rev/3b937d61c9a6