Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320325 - [validation] JSP source validators running even when respective batch validators have been turned off
Summary: [validation] JSP source validators running even when respective batch validat...
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
: 320324 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-19 16:56 EDT by Ian Tewksbury CLA
Modified: 2010-08-16 14:08 EDT (History)
2 users (show)

See Also:
nsand.dev: review+


Attachments
Fix Patch (2.60 KB, patch)
2010-07-19 16:58 EDT, Ian Tewksbury CLA
nsand.dev: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Tewksbury CLA 2010-07-19 16:56:33 EDT
Same issue exists in 3.2 as in 3.0.5

+++ This bug was initially created as a clone of Bug #320322 +++

Even if he JSP Content Validator and JSP Syntax Validator (both batch validators) are turned off using the Validation preferences page the source validators that those batch validators use are still run as you type.

The problem here is a disconnect between batch validators and source validators and the enablement of the batch validators.  The ValiatorStrategy checks for the enablement of the batch validators to determine which source validators are enabled but because there is currently no relation between the JSP batch validators and the source validators the ValidatorStrategy never sees the JSP source validators as disabled.

The fix for this problem is two fold.  First use the existing "sourceid" filed on the batch validator extension point to list all of the source validators related to a given batch validator.  In the case of JSP the relations are as follows:

JSPBatchValidator:
* JSPDirectiveValidator - org.eclipse.jst.jsp.tldsourcevalidator
* JSPELValidator - org.eclipse.jst.jsp.jspelsourcevalidator
* JSPJavaValidator - org.eclipse.jst.jsp.jspsourcevalidator
* JSPActionValidator - org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator

JSPContentValidator:
* JSPMarkupValidator - org.eclipse.jst.jsp.ui.internal.validation.markupvalidator
* JSPContentSourceValidator - org.eclipse.jst.jsp.ui.internal.validation.htmlsyntaxvalidator
* * this is actually a special case because strictly speeking the JSPContentValidator batch validator does not use the JSPContentSourceValidator but the JSPContentSourceValidator is itself checking the enablement of the JSPContentValidator batch validator to determine if its enabled thus establishment a pre-existing relationship between this source validator and this batch validator. The problem with the existing implementation of the relationship is that the JSPContentSourceValidator only checks the enablement of the JSPContentValidator batch validator on document connect which means if the enablement of the JSPContentValidator batch validator changes while a JSP document is open the JSPContentSourceValidator  will stay enabled.  Thus adding this relationship will ensure the JSPContentSourceValidator never runs if the JSPContentValidator batch validator is disabled.

The second fix that is needed is to update ValidatorStrategy to read the "sourceid" field of the batch validators as a comma separated value rather then as a single ID so that multiple source validators can be related to a single batch validator.  This is simply done using existing utility methods.

Patch to follow.
Comment 1 Ian Tewksbury CLA 2010-07-19 16:58:04 EDT
Created attachment 174675 [details]
Fix Patch

Fix patch for 3.2.x stream
Comment 2 Nitin Dahyabhai CLA 2010-07-19 17:02:02 EDT
*** Bug 320324 has been marked as a duplicate of this bug. ***
Comment 3 Nick Sandonato CLA 2010-08-16 14:07:57 EDT
Looks good. Thanks.