Bug 196554 - Errors missing in the error cache
Errors missing in the error cache
Product: java
Classification: Unclassified
Component: Source
PC Linux
: P2 (vote)
: 7.0
Assigned To: Jan Lahoda
Depends on:
Blocks: 188323
  Show dependency treegraph
Reported: 2011-03-10 16:39 UTC by Jan Lahoda
Modified: 2011-03-24 01:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2011-03-10 16:39:11 UTC
[custom build from recent sources]

Have two files in the same package, A.java and B.java:
public class A {
    B b;
    Unknown u;
public class B {
    A a;
    Unknown u;

Disable the OnePassCompileWorker in java.source (e.g. by adding "|| true" to "if (jt == null || units == null) {" in SuperOnePassCompileWorker).
Modify them both, switch to some other file and press Save All. One of the files will not have an error badge.

The problem is that org.netbeans.modules.java.source.indexing.DiagnosticListenerImpl.getDiagnostics compares JavaFileObjects on instance equality, but the instances may differ in MultipassWorker.
Comment 1 Jan Lahoda 2011-03-11 11:22:29 UTC
The original problem fixed by:
I would consider this patch to be quite safe.

I have found another problem where the errors were not reported correctly, and attempted to fix it:

These two would be good candidates for 7.0, I think, although I cannot claim that the second fix is safe.

I have also added option to disable the one-pass compile workers, as it seems that the multi-pass worker is apparently not properly tested:
The multi-pass worker can be forced using the following command line option:
Comment 2 Quality Engineering 2011-03-12 09:45:19 UTC
Integrated into 'main-golden', will be available in build *201103120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ae47803540da
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #196554: storing and getting Diagnostics based on their URIs, not FileObjects instances, as the FileObjects can differ in the MultiPassCompileWorker.
Comment 3 Dusan Balek 2011-03-15 13:38:20 UTC
The patch seems fine to me.
Comment 4 Jaromir Uhrik 2011-03-15 14:25:47 UTC
Verified in trunk based on verification of 188323. I agree with integration to NB7.0.
Comment 6 Jaromir Uhrik 2011-03-24 01:02:23 UTC
Marked as Verified in 70 - based on the verification of fix 188323.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo