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.
use this code in JSP: ---------------------- <!-- --> <% public void hello() { String s; } %> ---------------------- first line gets underlined with red exclamation -> illegal expression ... function declaration is not allowed in JSP content so correct error is shown but at incorrect line replace comment on first line by empty line -> error disapears error should be allways shown and preferably on correct line
confirmed. Dusane, can you fix at least the second part (no error annotation if the first line is empty)? It happens relatively often in JSP that the first line does not contain any text.
A bug in ErrorHintsProvider
A bug in JSP position converter IMHO. org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.getRealOffset returns '-1' for this case, which results in underlining of first line. In case there is nothing to underline, nothing is shown.
It often happens that I cannot translate the offset and need to return -1. I should reduce the number of situations when it happens, nevertheless it will still still happen in many cases. Currently if the offset is -1 the error is shown on the first line. However if the first line only contains whitespace characters, nothing is shown, not even an error icon and this is the primary problem. Btw. it would be great if we could show the errors in the status bar instead of the first line for -1, but this is not in scope of this issue
OK, from now on, error icon is shown on first line when the position is not resolved properly even when there are only whitespace chars (or just a newline). Correct position is up to JSP position converter.. --- http://hg.netbeans.org/main/rev/bec7bbd008c8
Integrated into 'main-golden', will be available in build *200809301401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/bec7bbd008c8 User: Max Sauer <msauer@netbeans.org> Log: #148036: No java error annotation if the first line of JSP is empty
Will we ever be able to provide a correct position? Or is this a WONTFIX issue?
I think the issue can be considered fixed after the change by msauer.
verified. NetBeans IDE 6.8 RC2 (Build 200912022200)