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 48485 - F12 jumps to 2nd error
Summary: F12 jumps to 2nd error
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 49344 (view as bug list)
Depends on:
Blocks: 76071
  Show dependency tree
 
Reported: 2004-09-04 21:52 UTC by _ gtzabari
Modified: 2008-12-22 13:24 UTC (History)
2 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 _ gtzabari 2004-09-04 21:52:44 UTC
dev build 200409011800

Upon compilation if there is an error and F12 is
pressed, it jumps to the 2nd error instead of the
first.
Comment 1 Miloslav Metelka 2004-09-06 09:19:44 UTC
Reassigning to core for evaluation
Comment 2 Martin Roskanin 2004-09-06 09:35:51 UTC
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.
Comment 3 David Simonek 2004-09-06 17:08:29 UTC
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.
Comment 4 _ tboudreau 2004-09-08 23:18:12 UTC
"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?

Comment 5 vanob 2004-09-09 02:22:29 UTC
Could you please look at 
http://www.netbeans.org/issues/show_bug.cgi?id=48702
I think it's somewhat related.
Comment 6 Martin Roskanin 2004-09-09 09:43:37 UTC
:-) 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
Comment 7 Martin Roskanin 2004-09-09 09:46:53 UTC
Uff, I am sorry. I think it is as designed behaviour. Forget my
previous comment
Comment 8 Martin Roskanin 2004-09-09 09:54:40 UTC
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
    }
Comment 9 _ gtzabari 2004-09-23 01:44:20 UTC
*** Issue 49344 has been marked as a duplicate of this issue. ***
Comment 10 _ gtzabari 2004-09-23 01:45:16 UTC
Tim,

Any update on this issue?
Comment 11 _ tboudreau 2004-09-23 03:53:58 UTC
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
Comment 12 David Konecny 2004-09-23 09:40:04 UTC
Works. Thanx.
Comment 13 _ gtzabari 2005-02-25 19:43:30 UTC
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.
Comment 14 _ gtzabari 2005-02-25 19:51:32 UTC
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.
Comment 15 _ tboudreau 2005-02-26 02:36:47 UTC
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.
Comment 16 Milos Kleint 2005-03-22 09:46:06 UTC
will try for 4.1
Comment 17 Milos Kleint 2005-03-23 14:55:42 UTC
done as suggested by tim, seems to work for me.
Comment 18 Petr Chytil 2007-01-02 15:09:27 UTC
closed.
Comment 19 Petr Chytil 2007-01-02 15:45:07 UTC
This issue continues to live in 6.0 trunk as #76071 .