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 148036 - No java error annotation if the first line of JSP is empty
Summary: No java error annotation if the first line of JSP is empty
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-23 13:51 UTC by Jindrich Sedek
Modified: 2009-12-03 08:10 UTC (History)
3 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 Jindrich Sedek 2008-09-23 13:51:39 UTC
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
Comment 1 Tomasz Slota 2008-09-26 12:09:05 UTC
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.
Comment 2 Dusan Balek 2008-09-26 13:17:19 UTC
A bug in ErrorHintsProvider
Comment 3 Max Sauer 2008-09-29 15:59:52 UTC
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.
Comment 4 Tomasz Slota 2008-09-29 16:50:40 UTC
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
Comment 5 Max Sauer 2008-09-30 10:13:46 UTC
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
Comment 6 Quality Engineering 2008-09-30 17:22:32 UTC
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
Comment 7 Petr Jiricka 2009-11-05 14:08:09 UTC
Will we ever be able to provide a correct position? Or is this a WONTFIX issue?
Comment 8 Tomasz Slota 2009-11-05 14:26:36 UTC
I think the issue can be considered fixed after the change by msauer.
Comment 9 Jindrich Sedek 2009-12-03 08:10:32 UTC
verified.
NetBeans IDE 6.8 RC2 (Build 200912022200)