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

Bug 317560

Summary: Errors flagged by error annotations not reflected in the Problems, Explorer, and/or Navigator views.
Product: [WebTools] WTP Source Editing Reporter: Rakesh <rakes123>
Component: jst.jspAssignee: Rakesh <rakes123>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: ccc, nsand.dev
Version: 3.0.5Flags: thatnitind: review+
Target Milestone: 3.0.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch
none
New patch
none
Adapter patch none

Description Rakesh CLA 2010-06-22 06:41:24 EDT
Build Identifier: M20091008-1320

Errors flagged by error annotations not reflected in the Problems, Explorer, and/or Navigator views.

Reproducible: Always

Steps to Reproduce:
1.  Create a Dynamic Web Project.                                           
2.  Create a JSP file.  File name must end with ".jsp"                     
3.  Double click the newly created file to open it in the JSP               
Structured Text Editor                                                     
4.  Add the following content to the JSP                                   
<jsp:body>                                                                 
5.  Press CTRL+s to save the document.                                     
6.  The tag is flagged with an Error Annotation because there is no end     
tag.  However, the Problems view and the Project Explorer / Navigator       
views do not reflect that an error exists in the JSP.                       
7.  Modify the document by replacing the existing text with the             
following text                                                             
<jsp:body>                                                                 
<TABLE>                                                                     
8.  Press CTRL+s to save the document.                                     
9.  Note that the missing end tags for <jsp:body> and <TABLE> are           
flagged with an Error Annotation but the Problems View and the Project     
Explorer / Navigator views are updated to reflect only the problem with     
the missing <TABLE> end tag.                                               
10.  Modify the document by replacing the existing text with the           
following text                                                             
<jsp:body>                                                                 
<P>                                                                         
11.  Press CTRL+s to save the document.                                     
12.  Note that the missing end tags for <jsp:body> and <P> are flagged     
with an Error Annotation but the Problems View and the Project Explorer     
/ Navigator views are not updated to reflected either error.
Comment 1 Rakesh CLA 2010-06-22 06:51:43 EDT
Created attachment 172403 [details]
Patch

Patch for Bugzilla corresponding to WI 49545 in Jazz(7552 stream)

Reason for this defect is: Markers attached to a resource, needed by problems view  is currently created in Validator V2 framework.
When we save it  V2 framework triggers build and create markers for errors.There is no 1-1 correspondence between error annotations and errors in problem view,since not all validators use V2 framework.I have moved MarkupValidator and JSPMarkupValidator from jst.jsp.ui to jst.jsp.core .Now it uses Validation V2 framework .I took some help from patch of  Bug 304620.
Comment 2 Nick Sandonato CLA 2010-06-22 15:56:28 EDT
Hi, Rakesh. Thanks for the patch. Unfortunately, I think it's very large and somewhat risky to put in. Is there any way for us to take advantage of the already existing source validators for JSP (JSPContentSourceValidator) to do the work that was done by the JSPMarkupSourceValidator? I know that in WTP 3.2, we've moved away from the JSPMarkupSourceValidator, so maybe we can do away with it in 305p as well.
Comment 3 Rakesh CLA 2010-06-25 03:05:21 EDT
Created attachment 172712 [details]
New patch

Added one more validator based on V2 framework , which uses JspMarkupValidator to validate.
Comment 4 Nick Sandonato CLA 2010-06-25 18:43:36 EDT
Created attachment 172826 [details]
Adapter patch

This is a different approach at patching this. While Rakesh's approach is definitely more succinct than the attached patch. I put this together because:

1) Adding another Validation Framework validator requires a new string, which we cannot do in this stream
2) We can keep build validators in the core plug-in
3) Content validation stays linked to the JSP Content validator
Comment 5 Carl Anderson CLA 2010-07-09 17:11:37 EDT
Committed to R3_0_5_patches

Note that the first change to org.eclipse.jst.jsp.ui's plugin.xml was already done in bug 316431.