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

Bug 332295

Summary: [parser] Tags are not properly handled inside comment
Product: [WebTools] WTP Source Editing Reporter: Sarika Sinha <sarika.sinha>
Component: jst.jspAssignee: Sarika Sinha <sarika.sinha>
Status: RESOLVED FIXED QA Contact: Nick Sandonato <nsand.dev>
Severity: normal    
Priority: P3 CC: sarika.sinha, thatnitind
Version: 3.2.3Flags: nsand.dev: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patc identifies the custom tags inside comment and parses them inside a container
none
Patch to identify the custom tag inside comments with fixed junit test
none
Patch to identify the custom tags inside comment with junit changes and file reopening problem resolved
none
Patch to identify the custom tags inside comment with junit changes and file reopening/String Empty problem resolved
nsand.dev: iplog+
Patch to identify the custom tags inside/outside comment with junit changes and file reopening problem resolved nsand.dev: iplog+

Description Sarika Sinha CLA 2010-12-10 06:28:24 EST
Build Identifier: M20101029-0800

If there is a tag inside comment, it gives error for comment not closed or the the regions are not properly constructed inside comments.

<!-- <meta> -->

gives error for comment not being closed.

Reproducible: Always
Comment 1 Sarika Sinha CLA 2010-12-10 06:32:18 EST
Created attachment 184939 [details]
Patc identifies the custom tags inside comment and parses them inside a container

This patch adds the logic for parsing the custom tags inside the comment as a container. Currently one junit is failing, I am working on correcting it.
Comment 2 Sarika Sinha CLA 2010-12-14 13:07:50 EST
Created attachment 185153 [details]
Patch to identify the custom tag inside comments with fixed junit test
Comment 3 Nick Sandonato CLA 2010-12-15 12:01:26 EST
Hi Sarika,

Thanks for the patch. I'm having a problem though where when I reopen these files with <!-- <meta> --> in them, I still see the "Comment not closed." message.

Also, SSE compiles against Java 1.4.2, which means that we can't make use of String#isEmpty(), which is used in your patch in the JSPTokenizer. We'll need to use String#length() == 0.
Comment 4 Sarika Sinha CLA 2010-12-15 23:56:39 EST
Created attachment 185288 [details]
Patch to identify the custom tags inside comment with junit changes and file reopening problem resolved
Comment 5 Sarika Sinha CLA 2010-12-16 02:14:49 EST
Created attachment 185294 [details]
Patch to identify the custom tags inside comment with junit changes and file reopening/String Empty problem resolved
Comment 6 Nick Sandonato CLA 2011-01-05 15:39:33 EST
Code checked in.
Comment 7 Nick Sandonato CLA 2011-01-05 15:54:40 EST
I actually backed out these changes, Sarika. I noticed, for example, if I had

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

in a document under <head> and I used Ctrl+Shift+C to comment out the entire tag, I'd still get "Comment not closed" errors.

Looks like there may be still something small missing.
Comment 8 Sarika Sinha CLA 2011-01-07 02:08:48 EST
Created attachment 186248 [details]
Patch to identify the custom tags inside/outside comment with junit changes and file reopening problem resolved

Hi Nick,
Currently the Custom tag after the comment closure was also parsed, I have added the check not to do so.
Comment 9 Nick Sandonato CLA 2011-01-07 13:26:24 EST
Code checked in. Thanks for your persistence.