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.
dev build 200409011800 Upon compilation if there is an error and F12 is pressed, it jumps to the 2nd error instead of the first.
Reassigning to core for evaluation
I can reproduce it, but slightly differently: (jdk142_03, build 040903, winXP) After each F12 keystroke, the caret jumps to an error, but after next F12 it jumps to the next line, where a duplicate error annotation is created... And as Gili reported after first F12 it jumps to the "duplicated" annotation of first error, usually on the next line, so it looks like the jump was performed on second error.
Passing to output, but for me here everything works as expected, first press of F12 always jumps to the first error and no duplicated err msgs. But I may have older sources or smt different.
"After each F12 keystroke, the caret jumps to an error, but after next F12 it jumps to the next line, where a duplicate error annotation is created..." Can you clarify this? I don't understand the difference between "After each F12 keystroke" and "after next F12" - which of the "each F12"'s is the "next F12"? Also, which caret - the Output Window's or the editor's?
Could you please look at http://www.netbeans.org/issues/show_bug.cgi?id=48702 I think it's somewhat related.
:-) Tim, I am sorry for this confusion. So I will describe problem more detailed: 1. Have a java file with two errors - one at the line 17, second at 25 - errors are correctly marked with parser annotation error glyphs 2. Press F9 3. Press F12 4. Now, a new glyph is created at the line 18(also caret is placed there), with the same tooltip as the error at 17 - (I assumed the glyph was duplicated, I think this could happen because of some Positions error) 5. Press F12 6. Caret is correctly set at the line 25, there is again something wrong in glyph area - there are two error glyphs at one line (25) 7. Press F12 8. again the same problem as in step 4 - one parser annotation glyph at line 25 and the second at line 26. Caret is at 26
Uff, I am sorry. I think it is as designed behaviour. Forget my previous comment
I missed that there are four errors in compliler output window. But it is strange that there are only two error annotations. Anyway, the original issue can be reproduced. See the step 4 in my repro case. The caret is at the line 18 not at 17, where the first error is. I have following errors: public One() { d } and public static void main(String[] args) { // TODO code application logic here d }
*** Issue 49344 has been marked as a duplicate of this issue. ***
Tim, Any update on this issue?
Checking in src/org/netbeans/core/output2/Controller.java; /cvs/core/output2/src/org/netbeans/core/output2/Controller.java,v <-- Controller.java new revision: 1.27; previous revision: 1.26 done
Works. Thanx.
I can reproduce this issue again in dev build 200502211900. What I noticed is that after hitting F9 (compile) the cursor is placed at the beginning of the line containing the first error (highlighted blue text). When you hit F12, it jumps to the 2nd error instead of the first. If, however, you move the cursor one line up, *then* hit F12 it works properly.
After further clarification this issue is probably 50% my fault. It turns out I can easily reproduce it if I hit F12 while the file/project is still being compiled. There seems to be no visual indication that Netbeans registered this keyboard click and then hitting F12 when compilation is complete jumps to the second error. Expected behavior when I hit F12 once during mid-compilation: 1) Either ignore the keystroke (and optional beep), or 2) Apply F12 keystokes once compilation is over (i.e. jump to first error immediately once compilation process is complete) Personally, I prefer the 2nd option. Whatever you decide, please ensure there is consistency between the visual state and internal state.
Probable fix: Add code to cause OutputWriter to fire a ChangeEvent whenever a line with a listener (a hyperlink). What's happening now is, I suspect a bit of a race condition: The error line has been written, and is in the model, but the UI (which, is polling to see if more data has been written) hasn't yet noticed that the line in question exists. So it sends the caret's stored position to somewhere on or after the first error line before the first error line has actually been displayed. Firing an event whenever a line that is a hyperlink is added would (at a probably trivial cost in extra repaints) force the UI to refresh, so the state would more likely be in sync.
will try for 4.1
done as suggested by tim, seems to work for me.
closed.
This issue continues to live in 6.0 trunk as #76071 .