Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338806

Summary: Unexpected closing comment inserted in Javascript block
Product: [WebTools] WTP Source Editing Reporter: Evgeniy Karyakin <anthropophagite>
Component: jst.jspAssignee: jst.jsp <jst.jsp-inbox>
Status: CLOSED DUPLICATE QA Contact: Nick Sandonato <nsand.dev>
Severity: major    
Priority: P3 CC: thatnitind
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Example JSP source code
none
Descriptive screenshot none

Description Evgeniy Karyakin CLA 2011-03-03 08:20:57 EST
Build Identifier: 20090920-1017

Starting type  JSP comment tag <%-- inside <script> tag leads to insertion of two hyphens just before closing </script> tag. When it happens in big long pages no one can spot it the moment it happened, and finally hit by unexpected javascript syntax errors in runtime.

Reproducible: Always

Steps to Reproduce:
1. Open example JSP file attached and place cursor on line 21.
2. Type JSP comment tag "<%--" (without quotes) symbol by symbol. Keep your eye on closing </script> tag.
3. After typing past hyphen you see two hyphens "--" just before closing script tag.

This happens if there is at least one Java code included between <script> and </script>, see lines 26-28 of the example source code. Remove these lines and this behaviour disappears.
Comment 1 Evgeniy Karyakin CLA 2011-03-03 08:21:48 EST
Created attachment 190260 [details]
Example JSP source code
Comment 2 Evgeniy Karyakin CLA 2011-03-03 08:30:21 EST
Created attachment 190264 [details]
Descriptive screenshot
Comment 3 Nick Sandonato CLA 2011-03-03 08:59:15 EST
Thanks for the bug report. This was fixed in the Helios SR2, which was just recently released.

*** This bug has been marked as a duplicate of bug 320001 ***