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.
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.
Created attachment 16995 [details] screen shot
Is this reproducible by any chance?
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.
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.
Computation of the line number is done by gjast. Reassigning to Tom for evaluation.
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!
Reorganization of java component