sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1784698 - in /sling/trunk/bundles/extensions/validation: api/src/main/java/org/apache/sling/validation/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apache/sling/validation/impl/model/
Date Tue, 28 Feb 2017 07:53:31 GMT
Author: kwin
Date: Tue Feb 28 07:53:30 2017
New Revision: 1784698

URL: http://svn.apache.org/viewvc?rev=1784698&view=rev
Log:
use generics for Predicate, fix some warnings

Modified:
    sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/ValidationService.java
    sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
    sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
    sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/model/ChildResourceBuilder.java

Modified: sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/ValidationService.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/ValidationService.java?rev=1784698&r1=1784697&r2=1784698&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/ValidationService.java
(original)
+++ sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/ValidationService.java
Tue Feb 28 07:53:30 2017
@@ -96,6 +96,6 @@ public interface ValidationService {
      * @throws IllegalArgumentException in case resourceType is absolute but outside of the
search paths or if no validation model could be found (and enforceValidation is {@code true}).
      * @throws SlingValidationException if one validator was called with invalid arguments
      */
-    @Nonnull ValidationResult validateResourceRecursively(@Nonnull Resource resource, boolean
enforceValidation, Predicate filter, boolean considerResourceSuperTypeModels) throws IllegalStateException,
IllegalArgumentException, SlingValidationException;
+    @Nonnull ValidationResult validateResourceRecursively(@Nonnull Resource resource, boolean
enforceValidation, Predicate<Resource> filter, boolean considerResourceSuperTypeModels)
throws IllegalStateException, IllegalArgumentException, SlingValidationException;
 
 }

Modified: sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java?rev=1784698&r1=1784697&r2=1784698&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
Tue Feb 28 07:53:30 2017
@@ -30,7 +30,6 @@ import org.apache.sling.api.resource.Log
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.commons.osgi.RankedServices;
-import org.apache.sling.serviceusermapping.ServiceUserMapped;
 import org.apache.sling.validation.impl.model.MergedValidationModel;
 import org.apache.sling.validation.impl.util.Trie;
 import org.apache.sling.validation.model.ValidationModel;

Modified: sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java?rev=1784698&r1=1784697&r2=1784698&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
Tue Feb 28 07:53:30 2017
@@ -35,9 +35,9 @@ public class ValidationResourceVisitor e
     private final boolean enforceValidation;
     private final boolean considerResourceSuperTypeModels;
     private final @Nonnull CompositeValidationResult result;
-    private final Predicate filter;
+    private final Predicate<Resource> filter;
 
-    public ValidationResourceVisitor(ValidationServiceImpl validationService, String rootResourcePath,
boolean enforceValidation, Predicate filter,  boolean considerResourceSuperTypeModels) {
+    public ValidationResourceVisitor(ValidationServiceImpl validationService, String rootResourcePath,
boolean enforceValidation, Predicate<Resource> filter,  boolean considerResourceSuperTypeModels)
{
         super();
         this.validationService = validationService;
         this.rootResourcePath = rootResourcePath + "/";
@@ -60,7 +60,7 @@ public class ValidationResourceVisitor e
             }
             // calculate the property name correctly from the root
             // the relative path must not end with a slash and not start with a slash
-            final String relativePath;
+            @Nonnull final String relativePath;
             if (resource.getPath().startsWith(rootResourcePath)) {
                 relativePath = resource.getPath().substring(rootResourcePath.length());
             } else {

Modified: sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/model/ChildResourceBuilder.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/model/ChildResourceBuilder.java?rev=1784698&r1=1784697&r2=1784698&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/model/ChildResourceBuilder.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/model/ChildResourceBuilder.java
Tue Feb 28 07:53:30 2017
@@ -31,7 +31,9 @@ public class ChildResourceBuilder {
     public boolean optional;
     public boolean multiple;
     String nameRegex;
+    @Nonnull
     private final List<ResourceProperty> resourceProperties;
+    @Nonnull
     private final List<ChildResource> children;
 
     public ChildResourceBuilder() {



Mime
View raw message