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 119669 - [60cat] Errors marked which are not errors
Summary: [60cat] Errors marked which are not errors
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC All
: P2 blocker with 1 vote (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 118817 (view as bug list)
Depends on:
Blocks: 121950
  Show dependency tree
 
Reported: 2007-10-22 16:40 UTC by darrinps
Modified: 2008-09-22 08:54 UTC (History)
4 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 darrinps 2007-10-22 16:40:04 UTC
I thought this issue was already raised, but didn't find exactly what I am describing so I'll add it now.

I have a large project with source that gets changed often.  After changes are made to the source (normally outside of
Netbeans...by others using Eclipse for example) my Netbeans project will show syntax errors in multiple files that seem
to be because of stale data.

For example, say class A uses class B.  If class B gets a method signature change, then Netbeans will show syntax errors
in Class A that even a clean build will not correct. Note that it will build, but the editor will still show the syntax
errors.

If I then load class B into the editor, and then go back to class A, the syntax error markers will, in time, go away.
Comment 1 darrinps 2007-10-26 17:50:36 UTC
I've noticed that if you load (double click) a file marked with a red exclamation point, give the IDE a chance to parse
it to see that there are no errors, then load another file, in a short time the original file's red exclamation point
will go away.

So, the code is there to remove these, it just isn't getting called in all of the right places/times.
Comment 2 Jiri Kovalsky 2007-10-31 14:54:40 UTC
This issue was reported by NetCAT 6.0 participant.
Comment 3 Jiri Kovalsky 2007-10-31 15:41:33 UTC
Upgarding priority since this problem is subject to very hot discussion [1] at NetCAT.

[1] http://www.nabble.com/-news--NetCAT-Status-Report---6.-tf4721330.html
Comment 4 Jan Lahoda 2007-10-31 17:28:56 UTC
Sorry, but we will need exact steps to reproduce.
Comment 5 _ wadechandler 2007-10-31 21:41:26 UTC
Well, it seems that the cache gets buggered. I can delete my var/cache folder and restart NB and they go away. It seems
the files which it thinks have errors can be fixed by reparsing the file in the background 1 time and remove the cache
file. So, when the IDE is started and a project opened etc if a file icon is badged with an error then the file can be
parsed in the background (using the algorithm the editor uses), and if the file has no errors, its cache file should be
deleted and recreated. That would solve the problem, and it would only need to be done for invalid cache files which
this should reflect yet all with errors would need to be reparsed once.

This seems to be the only thing causing it. I have these projects which I was using 5.5.1 to work on. In 5.5.1 I have a
platform 1.4.2 setup. In the latest NB 6.0 I had not setup 1.4.2 as a platform and named it 1.4.2. So, when I opened the
projects they all had reference problems caused by the named platform. So, I setup the platform. Some of the error
annotations/badges went away and some did not. I have like 20 or 30 projects. 

It isn't clear at all why it went away on some and not on some others, but it seems to just break some cache files or
something. To be clear, the annotations went away on about half my projects when I setup and named the platform
accordingly. The rest kept their project, package, and file level annotations/badges. I closed the IDE and deleted
var/cache. All icon badges went away.

I first thought about the cache when I actually changed a file. I changed one of the files with the error badged file
icon. I just put an extra space in one line. Then backspaced it out. Then I saved the file. Once the IDE reparsed the
file the error badge on that Node went away. I did it for all files in the one package and the package annotation/error
badge went away.

So, it seems the root cause is just invalid caches. My problem was caused by NB itself. It had parsed the files while I
had only the default platform setup. It then opened the project. I setup the platform the projects needed. The cache was
then corrupt for what ever reason. 

Some how there needs to be checks against the cache files. It seems a good time to perform a check on the file in the
background when the project is opened. It would only have to be done for files with error badges anyways.
Comment 6 Tomas Zezula 2007-11-01 22:02:53 UTC
*** Issue 118817 has been marked as a duplicate of this issue. ***
Comment 7 Tomas Zezula 2007-11-01 22:03:44 UTC
*** Issue 118817 has been marked as a duplicate of this issue. ***
Comment 8 Roman Strobl 2007-11-30 19:57:23 UTC
Might be related to this issue: http://www.netbeans.org/issues/show_bug.cgi?id=123181
Comment 9 i30817 2007-12-05 00:55:26 UTC
Just to be clear its just needed to delete the cache folder?
I did this and netbeans didn't recreate it. Now i'm worried that it will be slower that it should be (but the errors
went away).
I'm the user that reported a duplicate of this, on netbeans 6.0 b2 (also happens now with 6.0).
Comment 10 Jiri Prox 2007-12-05 09:24:06 UTC
to i30817: I've investigated your project and find out that your problem is caused mismatch between class name and file
name. So it should be marked as duplicate of issue 121561 rather than this one. 
Correct the file ViewToolTips.java (note the class in this file is named ViewTooltips - e.g. different case) and it
should start working ok.
Please check the location of your userdir, you maybe deleted cache in the wrong one.
Comment 11 pribyl 2008-09-22 08:54:12 UTC
I have to close this issue - INCOMPLETE for a long time.

However, still it would be great to know any progress in this issue (does it persist in recent builds?), so please - in 
case it still persist - reopen the issue. Otherwise please verify, that the problem has been solved.

Thanks a lot