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 47582 - [gjast] Incorrectly placed error annotations
Summary: [gjast] Incorrectly placed error annotations
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: Macintosh Mac OS X
: P3 blocker (vote)
Assignee: _ tball
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-20 19:03 UTC by _ tboudreau
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screen shot (191.26 KB, image/png)
2004-08-20 19:04 UTC, _ tboudreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2004-08-20 19:03:43 UTC
In the editor, I have just added the null check you see in the 
screen shot at the top of the editor.  The file is currently 
uncompilable, because the variable targetValue is assigned 
inside the scope of the if/then block, but used after it. 

The annotation in the screen shot appears and persists on the 
wrong line in the file.
Comment 1 _ tboudreau 2004-08-20 19:04:28 UTC
Created attachment 16995 [details]
screen shot
Comment 2 Martin Matula 2004-08-20 22:57:11 UTC
Is this reproducible by any chance?
Comment 3 _ tboudreau 2004-08-20 23:31:00 UTC
Yes, I just went back to the previous revision and tried the same edit again, and the same 
thing happened.  Do the following:

cd openide/src/org/openide/explorer/propertysheet/
cvs update -r 1.25 ComboInplaceEditor.java

Open the file and edit it.  Find the method reset().  Add at the beginning 

if (editor != null) {

Select the lines below up to the last line and indent them by pressing Tab.

Add a closing brackets before 
setSelectedItem(targetValue);

This will be uncompilable.  Save and wait for the error annotation.  Exactly the same thing 
happens.

Now here's an interesting thing:  I just tried exactly those same steps on my PC laptop.  On 
the PC the error annotation is wrong as well, but on the PC, the annnotation is on the "} 
else {" clause in the following method; on the mac it is one line below.  Same build on both 
machines.

Comment 4 Dusan Balek 2004-08-25 13:58:44 UTC
The annotation is attached to a wrong position because
ResourceImpl.ErrorInfoImpl.getLineNumber() returns wrong line number
for the particular error. It is perfectly reproducible (testing on
several sources from the Editor module applying similar scenario as
Tim describes).

Reassigning to javacore for further evaluation.
Comment 5 Martin Matula 2004-08-25 14:28:15 UTC
Computation of the line number is done by gjast. Reassigning to Tom
for evaluation.
Comment 6 _ tball 2004-09-02 00:16:56 UTC
Problem was caused by incorrect management of multiple source buffers
during error checking.  To reproduce, one needed to have a semantic
error in a file that had references to other classes for which only
source was available to the error checker.  Good catch!
Comment 7 Quality Engineering 2007-09-20 11:54:01 UTC
Reorganization of java component