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 153158 - Editor Window Reports False Compile Errors
Summary: Editor Window Reports False Compile Errors
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks: 121950
  Show dependency tree
 
Reported: 2008-11-13 15:47 UTC by regdunlop
Modified: 2015-02-25 19:18 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 regdunlop 2008-11-13 15:47:50 UTC
Sometimes the editor window indicates a large number of compile errors that have to do with class resolution.  I have
one NetBeans project which compiles into a JAR file.  A different project then includes that JAR file as a compile time
library.  The behavior is seemingly random, but often times the editor window indicates that all the classes in the
library JAR file are not known.  However, executing a build or clean & build on the project works just fine.

When I hover the mouse cursor over an editor indicated compile error, it will typically report a message like so...
"someFunction(); attempting to use incompatible return type
found : com.mypackage.FInternalFrame
required: FInternalFrame"

This is reported even though the library JAR file includes a class under the com.mypackage package that is called
FInternalFrame.  I know that the code is fine because project compiles with no errors.  I haven't found a reliable way
to solve this issue, but a combination of closing/opening NetBeans and closing/opening the project seems to fix it.

This isn't a huge issue, but it is very annoying.
Comment 1 Petr Chytil 2008-11-18 13:54:17 UTC
reassigning to editor for evaluation, please feel free to reassign further
Comment 2 Jiri Prox 2008-11-18 17:02:34 UTC
Can you please try deleting the cache at {userdir}/var/cache/index  ? 
If it doesn't help, it is possible to attach sample project?
Thanks
Comment 3 Rastislav Komara 2009-02-03 10:58:09 UTC
Overtake.
Comment 4 regdunlop 2009-02-09 17:38:43 UTC
Hello, I'm very sorry that it has taken this long to try your suggestion.  Deleting the contents of the index folder and
restarting NetBeans did resolve the issue.  Would you still like me to post a sample project?
Thanks for you help
Comment 5 Jiri Prox 2009-02-10 10:38:46 UTC
Thanks for response. It is good news that deleting cache helped. Sending the project is not necessary then. 
The problem was in broken cache -  the question is what did break it?  Any steps to reproduce are welcome although I
know it's hard to find them out. 

I'll leave this issue opened for a while and INCOMPLETE, and see if anybody can find the action which break the cache

Thanks 

Comment 6 regdunlop 2009-02-10 16:11:00 UTC
OK, I think I can reproduce it at will now.  I have one project which is named Desktop.  This project compiles into a
JAR file.  The second project is called RMS.  The RMS project includes the Desktop JAR file as a compile-time library.

This is the sequence of events...

1) I have both projects open, I have multiple java files from both projects open in editor, currently viewing one of the
java file in the RMS project, and I notice the issue.
2) Exit NetBeans
3) Delete the cache index folder
4) Launch NetBeans (both projects are open by default)
5) NetBeans indexes and compiles the projects (in the lower right hand corner) - I wait for this to complete
6) Right-Click on the Desktop project and select "Clean & Build"
7) After the build completes, every java file in the RMS project that is open in the editor gets the little red '!'
icon, indicating compile errors
8) Even though the currently viewed java file has the little '!' icon, there are no red lines.
9) View a different java file in the RMS project
10) There is a delay of about 2-3 seconds, then the editor window marks the code with red underlines

Not sure if this makes a difference, but I have custom build scripts on both projects.  I edited the build.xml file to
override the following Ant tasks: -post-clean, -pre-compile, -do-jar, and jar

Please let me know if I can provide any more helpful information.
Thanks

Comment 7 Rastislav Komara 2009-03-24 15:41:27 UTC
Thanks for steps to reproduce. Covering under badges umbrella issue to solve as one problem.
Comment 8 Vitezslav Stejskal 2009-04-24 14:42:23 UTC
"Please let me know if I can provide any more helpful information." - What IDE version are you using? Could you please
attach here <ide-userdir>/var/log/messages.log? Would it be possible for you to attach the two projects that exhibit the
problem? Thanks
Comment 9 Dusan Balek 2009-08-14 14:09:20 UTC
Could you please try to run your IDE with -J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE
property, reproduce the issue, and attach the messages.log file to this issue? Also, attaching the build scripts of your
projects could be useful.
Thanks.
Comment 10 Jan Lahoda 2009-08-20 10:01:31 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 11 ralphlevan 2015-02-25 19:18:14 UTC
I've got the same problem.  I can't find the location specified for clearing my cache in my Windows 7 machine.  This problem has been open for 6 years now. It seems some progress would have been made on it by now.