Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340743 - Setting validators to manual will not fire them during incremental build
Summary: Setting validators to manual will not fire them during incremental build
Status: RESOLVED INVALID
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.validation (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: wst.validation CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-23 07:47 EDT by Patric Rufflar CLA
Modified: 2011-04-20 13:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patric Rufflar CLA 2011-03-23 07:47:47 EDT
Build Identifier: 3.2.1

I'd like to validate a jsp file (using the JSP Syntax validator) on an incremental build (only), e.g. after saving a changed jsp file.

In earlier releases of WTP it was sufficient to uncheck the build validator and to check the "manual" validator.
In WTP 3.2.1, manual validators aren't fired on an incremental build anymore.

This causes that our developers don't get any response on a change jsp file if something is broken (or fixed). They have to use the "Validate" context menu function after every save action which is quite ineffective and error-prone.


Reproducible: Always

Steps to Reproduce:
1. Disable "build" validators in the preference dialog, enable "manual" validators
2. Enable "build automatically"
3. Change a jsp file in a dynamic web project which contains a java error
4. Save the file
5. No errors are disabled (only if you explicitly click on Validate on the file's context menu)
Comment 1 Gary Karasiuk CLA 2011-03-24 06:22:16 EDT
Patric, 

The build preference controls whether the validator runs a build time, including incremental build. By disabling that preference you are instructing the validator NOT to run at build time.
Comment 2 Patric Rufflar CLA 2011-03-24 06:38:46 EDT
Gary,

can you please tell me how to configure WTP that a jsp will only be validated on save (AUTO_BUILD), but not on a full build (because this would take more than 10 minutes)?

This was possible in WTP 3.0.
Comment 3 Gary Karasiuk CLA 2011-03-24 10:04:46 EDT
Patric, 

I don't think that the validation framework ever worked the way that you are suggesting. I added the new validation framework to WTP in 3.0, and it hasn't changed much since then. I did a quick test on WTP 1.5.5, and it also needs the build preference turned on for validators to be called as part of incremental build. 

But to answer your question, no, the validation framework does not provide a way for validators to distinguish between clean builds, full builds and incrementation builds. If a resource is built by the platform, then the build validators are also run.

If this is a concern, one approach would be to manually suspend all the validation before doing a clean build, do the clean build and then unsuspend validation. (You can suspend all validation with one checkbox). Hopefully, you rarely need to do clean builds.
Comment 4 Patric Rufflar CLA 2011-03-24 11:24:51 EDT
Gary,

did you check the "JSP Syntax Validator" on "Manual" in your preferences?

I retested it with Eclipse 3.4.2 and WTP 3.0.4, it definitely works there.

My validation preferences are:
All validators are unchecked, except "JSP Syntax Validator" which is checked at "Manual".

A full build does not trigger validation, however, auto/incremental build does.
Comment 5 Gary Karasiuk CLA 2011-03-24 12:06:02 EDT
I tried on it's cousin validator, the "HTML syntax validator", since I wasn't sure how to trigger a JSP syntax error. 

What is an example error that I could try?
Comment 6 Nitin Dahyabhai CLA 2011-03-24 14:13:40 EDT
(In reply to comment #4)
> A full build does not trigger validation, however, auto/incremental build does.

This is verified by changes in the Markers/Problems view and activity in the Progress view?
Comment 7 Gary Karasiuk CLA 2011-03-24 14:42:32 EDT
I installed Eclipse 3.4.2 and WTP 3.0.4, and I am not seeing the behavior that you described.

1) I disabled all the validators, except the JSP Syntax Validator.
2) I created a web project with a single JSP file

I had auto build on. I had the build preference on for the JSP Syntax Validator.

If I introduced an error, it would show up when I saved the file. As expected.
If I did a clean build the error would remain. As expected.

When I removed the error, the marker disappeared when I saved the file. As expected.

When I turned the build preference off, the error would not show up unless I did a manual validation. Nor would fixing the error show up unless I did a manual validation.

As near as I can tell, this is all working as designed. 

Perhaps you have project level validators set? Or maybe you are seeing as-you-type validation, which is different then build based validation.
Comment 8 Patric Rufflar CLA 2011-03-25 05:22:47 EDT
Gary, Nitin,

thank both of you for your comments, I think we're getting closer.

>What is an example error that I could try?
For example: Create an empty jsp file and paste:
<html>
<body>
<% bla %>
</body>
</html>

>This is verified by changes in the Markers/Problems view and activity in the
>Progress view?
No, the error doesn't show up here.

>Or maybe you are seeing
>as-you-type validation, which is different then build based validation.
Ah yes, that might be the case!
(although the as-you-type validation seems be triggered on a save action only, not "as I type")

This results in a slightly change of my bug report:
"As-you-type-validation seems not be triggered anymore in all cases".

Try the above error example in the most recent WTP and you will see that the as-you-type-validation-on-save will not mark an error in the above example while WTP 3.0 did. (validators configured as described in comment 4)
Comment 9 Patric Rufflar CLA 2011-04-19 15:43:32 EDT
Gary, Nitin,

did you have any changes to test the situation described in my previous comment 8?

Thank you
Comment 10 Nitin Dahyabhai CLA 2011-04-20 13:11:21 EDT
(In reply to comment #9)
> Gary, Nitin,
> 
> did you have any changes to test the situation described in my previous comment
> 8?

Only whether enabling that validator for the Automatic case makes a difference.