Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Problem with V2 validation framework.
Problem with V2 validation framework. [message #227126] Thu, 22 January 2009 17:32 Go to previous message
Alexandros Salazar is currently offline Alexandros Salazar
Messages: 15
Registered: July 2009
Junior Member
Hi,

I'm trying use the V2 validation framework in order to make use of its
dependency handling abilities. I _think_ I have found a bug in how markers
are created, but I want to double check to see if maybe I misunderstood.

As allowed by the API, I use org.eclipse.wst.validation.ValidatorMessage
in the ValidationResult to let the framework handle the creation and
destruction of markers for me. I specify a marker ID in the extension
point as follows:

<extension
id="my.company.validation.module.dependency"
name="Dependency Carrying Module Validator"
point="org.eclipse.wst.validation.validatorV2">
<validator
build="true"
class="my.company.validation.ModuleDependencyCarryingValidator "
manual="true"
markerId="my.company.marker.module.dependency">
</validator>
</extension>

Now, when the time comes to create the message that I will return in my
implementation of AbstractValidator#validate, I use the following code:

ValidationResult result = new ValidationResult();
ValidatorMessage message = ValidatorMessage.create("Detected error.",
errorFile);
message.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
result.setDependsOn(dependsOnResources.toArray(new
IResource[resources.size()]));
result.add(message);
return result;

This behaves as follows: upon clean build, the error is properly detected.
If I modify the files that the validator depends so as to remove the
error, the validator is duly called. However, the marker from the previous
validation is never removed.

I tracked down the reason for this to the fact that the type of the marker
is always the same, and markers are searched for according to their type
by Eclipse, not their ID, which is what the extension point provides.

Does anyone know if I misunderstood the purpose of the marker ID, or if I
should file a bug with bugzilla? Thanks!
 
Read Message
Read Message
Previous Topic:Dynamic Web Project isn't building class files
Next Topic:how to remove faulty parts of Jsdt
Goto Forum:
  


Current Time: Fri May 24 22:00:14 EDT 2013

Powered by FUDForum. Page generated in 0.01651 seconds