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 226207 - JSP editor point an error in tag file, but no error is shown in the file it self.
Summary: JSP editor point an error in tag file, but no error is shown in the file it s...
Status: REOPENED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC All
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
: 227026 227347 228770 228899 229642 231719 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-16 03:43 UTC by ecerichter
Modified: 2013-08-22 08:19 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Error shown in navigator (13.87 KB, image/png)
2013-02-16 03:44 UTC, ecerichter
Details
Errors shown in action items window (36.61 KB, image/png)
2013-02-16 03:45 UTC, ecerichter
Details
Editor window has no error (58.62 KB, image/png)
2013-02-16 03:46 UTC, ecerichter
Details
Here is the (ofending?) tag file (1.62 KB, application/octet-stream)
2013-02-16 03:46 UTC, ecerichter
Details
Tag file 2 (1.67 KB, application/octet-stream)
2013-03-10 23:15 UTC, ecerichter
Details
Another example (1.43 KB, application/octet-stream)
2013-05-28 07:53 UTC, mslama
Details
This is a case that cannot be solved by adding "//" to the line. (2.80 KB, application/octet-stream)
2013-07-04 18:43 UTC, ecerichter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerichter 2013-02-16 03:43:53 UTC
Product Version = NetBeans IDE 7.3 RC2 (Build 201302050851)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_13
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.7-b01

NetBeans points that there is an error in the tag file, but no error is presented in editor, and there is no clue about the problem.
In action items, I can see the messages in attached screenshot.
In the navigator, the file has the error icon near to it.
But editor show no error at all.
What is the problem?
Attached is also the tag file. It works perfectly, has no error at all.
Comment 1 ecerichter 2013-02-16 03:44:51 UTC
Created attachment 131446 [details]
Error shown in navigator
Comment 2 ecerichter 2013-02-16 03:45:15 UTC
Created attachment 131447 [details]
Errors shown in action items window
Comment 3 ecerichter 2013-02-16 03:46:01 UTC
Created attachment 131448 [details]
Editor window has no error
Comment 4 ecerichter 2013-02-16 03:46:48 UTC
Created attachment 131449 [details]
Here is the (ofending?) tag file
Comment 5 Martin Fousek 2013-02-18 06:04:01 UTC
I think that your issue with the navigator could be resolved in the newest development build because it seems to be related to issue #225442. Please give it another try there:
http://bits.netbeans.org/download/trunk/nightly/latest/

Thanks.
Comment 6 ecerichter 2013-02-18 13:42:23 UTC
Downloaded latest DEV build, opened the offending file, changed one line (just hit enter), and save.
NetBeans analyzed the file and reported no errors.

Thanks,

Edson Richter

*** This bug has been marked as a duplicate of bug 225442 ***
Comment 7 Vladimir Riha 2013-02-22 14:01:07 UTC
I'm sorry but I can still reproduce it, simply open the tag file in JavaWeb project:

=> file has error badge (in Projects but also in editor's tab) though no line is marked wrong

It is caused by this, removing <c:if></c:if> helps:

<script type="text/javascript">
    function __${name}_onblur() {
        var cpo = jQuery("#${name}");
        var valor = jQuery.trim(cpo.val());
    <c:if test="${uppercase}">
        valor = valor.toUpperCase();
    </c:if>
            cpo.val(valor);


            return false;
        }

        jQuery("#${name}").forceText();


</script>





Product Version: NetBeans IDE Dev (Build web-main-9957-on-20130222)
Java: 1.7.0_15; Java HotSpot(TM) Client VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b03
System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb)
Comment 8 ecerichter 2013-02-22 14:08:17 UTC
Well, I'm using DEV 20130220, and it has been working since isssue 225442 was fixed.

I can't reproduce the error anymore.

Regards,

Edson
Comment 9 Vladimir Riha 2013-02-22 14:11:34 UTC
Weird but it doesn't work for me. Some duplicated issues to #225442 are still reproducible as well, so I'll mark it as duplicate again and reopen the mentioned issue instead.

*** This bug has been marked as a duplicate of bug 225442 ***
Comment 10 ecerichter 2013-02-22 15:59:26 UTC
I'm sorry to say that I was not using 201302202300 DEV build as I was thinking.
I was using 201302172300 which does not has this issue.
The problem returned in 201302202300.
Comment 11 Vladimir Riha 2013-02-22 16:08:03 UTC
Thanks for confirmation. I agree with you that it really still is duplicate of 225442, so I reopened that issue, but let's wait for evaluation
Comment 12 Petr Hejl 2013-02-22 19:05:42 UTC
It is imo problem with JSP embedding the <c: .... part should not be part of JS embedded code.
Comment 13 Vladimir Riha 2013-03-05 13:08:10 UTC
Possibly duplicate of this is issue 227026
Comment 14 Vladimir Riha 2013-03-08 10:12:27 UTC
*** Bug 227026 has been marked as a duplicate of this bug. ***
Comment 15 ecerichter 2013-03-10 23:15:28 UTC
Created attachment 132434 [details]
Tag file 2

Ok, now I'm able to reproduce the problem.

1) I've upgraded to 201303052300 just to be sure.
2) I've attached another tag file (tag file 2)

If I insert a blank line a at line 3...


change from

<%@tag description="Text input field" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@attribute name="name" required="true" type="java.lang.String"%>
<%@attribute name="value" required="true" type="java.lang.String"%>
<%@attribute name="maxlength" required="true" type="java.lang.Integer" %>

make some edit in the file, like:

<%@tag description="Text input field" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@attribute name="name" required="true" type="java.lang.String"%>
<%@attribute name="value" required="true" type="java.lang.String"%>
<%@attribute name="maxlength" required="true" type="java.lang.Integer" %>

Then the (red sign) error disappear.
Comment 16 ecerichter 2013-03-10 23:34:45 UTC
I've tried to track this error.
I noticed that whenever the red sign appears, I get also the following errors in IDE log:

INFO [org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer]: Disabled an invalid highlighting layer: hlStartOffset=941 < previous hlEndOffset=951 for layer=org.netbeans.modules.html.editor.coloring.EmbeddingHighlightsContainer@2d4b39e
INFO [org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer]: Disabled an invalid highlighting layer: hlStartOffset=940 < previous hlEndOffset=950 for layer=org.netbeans.modules.html.editor.coloring.EmbeddingHighlightsContainer@2d4b39e


Would be this a glue for this problem?

Regards,

Edson
Comment 17 Vladimir Riha 2013-03-13 13:16:50 UTC
*** Bug 227347 has been marked as a duplicate of this bug. ***
Comment 18 Petr Pisl 2013-03-14 01:31:31 UTC
There is no simple solution to fix this issues. I'm afraid that there is not enough time to put this issue to the patch 1.
Comment 19 ecerichter 2013-04-06 19:53:46 UTC
I don't know if this has been worked, but seems to not happen since DEV201304042355.

Appear that fix for issue 227523 has affected this issue.

Would worth to ask others who have been facing this issue to test in latest DEV and if this is the case, close this as fixed.

Thanks,

Edson
Comment 20 mslama 2013-04-08 09:26:16 UTC
Yes on DEV build 201304042355 it looks better.
Comment 21 Vladimir Riha 2013-04-19 14:10:31 UTC
*** Bug 228770 has been marked as a duplicate of this bug. ***
Comment 22 Vladimir Riha 2013-04-23 13:59:37 UTC
*** Bug 228899 has been marked as a duplicate of this bug. ***
Comment 23 Vladimir Riha 2013-05-13 10:19:18 UTC
*** Bug 229642 has been marked as a duplicate of this bug. ***
Comment 24 ecerichter 2013-05-22 15:26:48 UTC
I't seems that the problem has gone in DEV201305212300.
Comment 25 mslama 2013-05-28 07:53:34 UTC
Created attachment 134989 [details]
Another example

This example contains <s:message code="profileName"/> inside JS code. It works. When I check generated page this tag is replaced even if I do not know how/when it is resolved. Is such construction correct? If not what code shall I use instead? For this case again IDE should error badge on file in Projects tab but does not show any error in file in editor. Shall I file new issue for this case?
Comment 26 mslama 2013-05-28 07:54:35 UTC
IDE version is Build 201305232300.
Comment 27 Vladimir Riha 2013-05-28 08:06:26 UTC
Still reproducible with file from comment #4, reopening.




mslama: I think your problem could be slightly different, you have 4 quotes used like this

var profile ="<s:message code="profileName"/>";

so the profileName here seems to be considered as JS code, would it help (at least as a workaround) to use single quotes instead? Like this:

var profile ='<s:message code="profileName"/>';





Product Version: NetBeans IDE Dev (Build web-main-10633-on-20130528)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.2.0-43-generic-pae running on i386; UTF-8; en_US (nb)
Comment 28 mslama 2013-05-28 08:19:28 UTC
Yes you are right. Single quote fixes problem. Thanks for fast response.
Comment 29 mslama 2013-05-28 08:20:42 UTC
Sorry default status is REOPENED. I think it should better not to change status as default behavior.
Comment 30 Vladimir Riha 2013-05-28 08:23:37 UTC
You're welcome.

I reopened this issue because initial problem is still reproducible.
Comment 31 mslama 2013-05-28 08:24:50 UTC
REOPENED status is set when I select Add Comment. Back to my issue: Problem is that editor does not show error on offending line ie. line with s:message in this case. Is it possible for editor to show error at relevant line in case of wrong double quotes?
Comment 32 mslama 2013-05-28 08:25:14 UTC
Ok Sorry. I thought I did it by accident.
Comment 33 Vladimir Riha 2013-05-30 12:17:55 UTC
(In reply to comment #31)
> Is it possible for editor to show error at relevant line in case of
> wrong double quotes?

It does in my case, correct line is red underlined in editor
Comment 34 ecerichter 2013-05-30 15:40:26 UTC
(In reply to comment #33)
> (In reply to comment #31)
> > Is it possible for editor to show error at relevant line in case of
> > wrong double quotes?
> 
> It does in my case, correct line is red underlined in editor

Interesting. For me, the file is shown with red mark in Project explorer and in Action Items. But when I open in the editor, the line is not marked.

Not so bad that I can double click in Action Items item and get the cursor in the correct line of code.
Comment 35 Vladimir Riha 2013-06-24 12:44:21 UTC
*** Bug 231719 has been marked as a duplicate of this bug. ***
Comment 36 ecerichter 2013-07-02 23:15:22 UTC
This is solved as per DEV201307012300.
Closing as fixed, thanks!!!
Comment 37 ecerichter 2013-07-02 23:50:08 UTC
Sorry, as Jiri explained, I should not use "fixed" - besides it is fixed somehow...
Comment 38 snaketl 2013-07-03 18:42:36 UTC
Tested now in build 201307022300, the problem still remains. Try using this example (https://netbeans.org/bugzilla/show_bug.cgi?id=231719)
Comment 39 ecerichter 2013-07-04 18:43:05 UTC
Created attachment 136722 [details]
This is a case that cannot be solved by adding "//" to the line.

Reopening the issue.

This file presents the same problem: when I open the project, it is marked with red badge (also in Action Items), when I open in editor, error disappear (from project tree and from action items).

Seems that there are different evaluators at different stages of evaluation.

Next time when I open the project, the error is there again.

I can't mark the lines as javascript comment, because when I run the page I get an error of invalid character by JSTL processing.

Already tried to delete caches, but no success. Still the same behavior.
Comment 40 ecerichter 2013-07-04 18:44:21 UTC
Last tested with DEV201307032300.