You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2016/10/26 07:05:46 UTC

svn commit: r1766631 - in /sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation: AbstractValidator.java BundleProjectValidator.java

Author: kwin
Date: Wed Oct 26 07:05:46 2016
New Revision: 1766631

URL: http://svn.apache.org/viewvc?rev=1766631&view=rev
Log:
SLING-4070 do not explicitly remove marker ids when they are set on the validated resource (this is done by WST validation framework)

Modified:
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/AbstractValidator.java
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/BundleProjectValidator.java

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/AbstractValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/AbstractValidator.java?rev=1766631&r1=1766630&r2=1766631&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/AbstractValidator.java (original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/AbstractValidator.java Wed Oct 26 07:05:46 2016
@@ -28,8 +28,14 @@ public abstract class AbstractValidator
 
     protected final static String VALIDATION_MARKER_TYPE = "org.apache.sling.ide.eclipse-core.validationMarker";
 
+    /**
+     * Deletes all validation markers in the given resource.
+     * Usually markers are automatically cleared by the validation framework before the validators are triggered for a specific resource.
+     * This method only needs to be called in case the validator sets markers outside of the resource for which validation was triggered.
+     * @param resource
+     * @throws CoreException
+     */
     protected void deleteValidationMarkers(IResource resource) throws CoreException {
-        
         // delete validation markers
         resource.deleteMarkers(VALIDATION_MARKER_TYPE, false, IResource.DEPTH_ZERO);
     }
@@ -37,7 +43,8 @@ public abstract class AbstractValidator
     protected void addValidatorMessage(ValidationResult res, IResource resource, String msg) {
         ValidatorMessage message = ValidatorMessage.create(msg, resource);
         message.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
-        // ID is not taken over from the extension point (that only works for the IReporter, which is still provisional)
+        // ID is not taken over from the extension point (that only works for the IReporter (which is for validation V1)
+        // reported at https://bugs.eclipse.org/bugs/show_bug.cgi?id=307093)
         message.setType(VALIDATION_MARKER_TYPE);
         res.add(message);
     }

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/BundleProjectValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/BundleProjectValidator.java?rev=1766631&r1=1766630&r2=1766631&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/BundleProjectValidator.java (original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/internal/validation/BundleProjectValidator.java Wed Oct 26 07:05:46 2016
@@ -44,7 +44,6 @@ public class BundleProjectValidator exte
             if (!resource.isSynchronized(IResource.DEPTH_ZERO)) {
                 resource.refreshLocal(IResource.DEPTH_ZERO, null);
             }
-            deleteValidationMarkers(resource);
             for (IFile descriptor : scValidator.findMissingScrDescriptors((IFile)resource)) {
                 addValidatorMessage(res, resource, "No DS descriptor found at path " + descriptor.getProjectRelativePath() +".");
             }