bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject [07/15] bval git commit: code updates
Date Wed, 15 Nov 2017 22:54:12 GMT
code updates


Project: http://git-wip-us.apache.org/repos/asf/bval/repo
Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/31e1eff6
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/31e1eff6
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/31e1eff6

Branch: refs/heads/bv2
Commit: 31e1eff6556f6d5de5eccf7ba150afa967aa45ee
Parents: 8f19bcb
Author: Matt Benson <mbenson@apache.org>
Authored: Wed Nov 15 16:27:10 2017 -0600
Committer: Matt Benson <mbenson@apache.org>
Committed: Wed Nov 15 16:53:43 2017 -0600

----------------------------------------------------------------------
 .../main/java/org/apache/bval/el/ELFacade.java  | 16 +---
 .../bval/jsr/AnnotationConstraintBuilder.java   | 38 +++-----
 .../apache/bval/jsr/AnnotationProcessor.java    | 11 ++-
 .../bval/jsr/CascadingPropertyValidator.java    | 96 +++++++++++++++-----
 .../bval/jsr/ConstraintValidatorIdentity.java   |  9 +-
 .../jsr/DefaultConstraintValidatorFactory.java  | 12 +--
 .../bval/jsr/DefaultMessageInterpolator.java    | 35 +++----
 .../jsr/DefaultValidationProviderResolver.java  | 50 ++++------
 .../org/apache/bval/jsr/GraphBeanIdentity.java  | 28 +-----
 .../java/org/apache/bval/jsr/groups/Group.java  | 13 ++-
 .../groups/GroupConversionDescriptorImpl.java   |  3 +-
 .../java/org/apache/bval/jsr/groups/Groups.java |  8 +-
 .../apache/bval/jsr/groups/GroupsComputer.java  | 16 ++--
 .../parameter/DefaultParameterNameProvider.java | 25 +++--
 .../resolver/CachingTraversableResolver.java    | 26 ++----
 .../org/apache/bval/jsr/util/ClassHelper.java   | 10 +-
 .../main/java/org/apache/bval/jsr/util/IOs.java | 11 +--
 .../apache/bval/jsr/util/PathNavigation.java    | 10 +-
 .../java/org/apache/bval/jsr/util/Proxies.java  |  2 +-
 19 files changed, 200 insertions(+), 219 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/el/ELFacade.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/el/ELFacade.java b/bval-jsr/src/main/java/org/apache/bval/el/ELFacade.java
index 49f236b..9798455 100644
--- a/bval-jsr/src/main/java/org/apache/bval/el/ELFacade.java
+++ b/bval-jsr/src/main/java/org/apache/bval/el/ELFacade.java
@@ -54,10 +54,9 @@ public final class ELFacade implements MessageEvaluator {
             if (EXPRESSION_FACTORY != null) {
                 final BValELContext context = new BValELContext();
                 final VariableMapper variables = context.getVariableMapper();
-                for (final Map.Entry<String, Object> var : annotationParameters.entrySet()) {
-                    variables.setVariable(var.getKey(),
-                        EXPRESSION_FACTORY.createValueExpression(var.getValue(), Object.class));
-                }
+                annotationParameters.forEach(
+                    (k, v) -> variables.setVariable(k, EXPRESSION_FACTORY.createValueExpression(v, Object.class)));
+
                 variables.setVariable("validatedValue",
                     EXPRESSION_FACTORY.createValueExpression(validatedValue, Object.class));
 
@@ -83,13 +82,8 @@ public final class ELFacade implements MessageEvaluator {
     }
 
     private static class BValELContext extends ELContext {
-        private final FunctionMapper functions;
-        private final VariableMapper variables;
-
-        public BValELContext() {
-            this.variables = new BValVariableMapper();
-            this.functions = new BValFunctionMapper();
-        }
+        private final FunctionMapper functions = new BValFunctionMapper();
+        private final VariableMapper variables = new BValVariableMapper();
 
         @Override
         public ELResolver getELResolver() {

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationConstraintBuilder.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationConstraintBuilder.java b/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationConstraintBuilder.java
index 017cabb..4b15ba7 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationConstraintBuilder.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationConstraintBuilder.java
@@ -72,7 +72,7 @@ final class AnnotationConstraintBuilder<A extends Annotation> {
         final boolean reportFromComposite =
             annotation != null && annotation.annotationType().isAnnotationPresent(ReportAsSingleViolation.class);
         constraintValidation =
-            new ConstraintValidation<A>(validatorClasses, annotation, owner, access, reportFromComposite, target);
+            new ConstraintValidation<>(validatorClasses, annotation, owner, access, reportFromComposite, target);
         buildFromAnnotation();
     }
 
@@ -139,7 +139,7 @@ final class AnnotationConstraintBuilder<A extends Annotation> {
         if (!foundGroups) {
             throw new ConstraintDefinitionException("Annotation " + annotationType.getName() + " has no groups method");
         }
-        if (validationAppliesTo != null && !ConstraintTarget.IMPLICIT.equals(validationAppliesTo.getDefaultValue())) {
+        if (validationAppliesTo != null && ConstraintTarget.IMPLICIT != validationAppliesTo.getDefaultValue()) {
             throw new ConstraintDefinitionException("validationAppliesTo default value should be IMPLICIT");
         }
 
@@ -257,9 +257,9 @@ final class AnnotationConstraintBuilder<A extends Annotation> {
 
         final Set<Class<? extends Payload>> payloadSet;
         if (payload_raw == null) {
-            payloadSet = Collections.<Class<? extends Payload>> emptySet();
+            payloadSet = Collections.emptySet();
         } else {
-            payloadSet = new HashSet<Class<? extends Payload>>(payload_raw.length);
+            payloadSet = new HashSet<>(payload_raw.length);
             Collections.addAll(payloadSet, payload_raw);
         }
         constraintValidation.setPayload(payloadSet);
@@ -323,18 +323,13 @@ final class AnnotationConstraintBuilder<A extends Annotation> {
      * @return An integer index always >= 0
      */
     private int computeIndex(ConstraintValidation<?> composite) {
-        int idx = 0;
-        for (ConstraintValidation<?> each : constraintValidation.getComposingValidations()) {
-            if (each.getAnnotation().annotationType() == composite.getAnnotation().annotationType()) {
-                idx++;
-            }
-        }
-        return idx;
+        return (int) constraintValidation.getComposingValidations().stream()
+            .filter(v -> v.getAnnotation().annotationType().equals(composite.getAnnotation().annotationType())).count();
     }
 
     /** read overridesAttributes from constraintValidation.annotation */
     private void buildOverridesAttributes() {
-        overrides = new LinkedList<ConstraintOverrides>();
+        overrides = new LinkedList<>();
         for (Method method : constraintValidation.getAnnotation().annotationType().getDeclaredMethods()) {
             final OverridesAttribute.List overridesAttributeList = method.getAnnotation(OverridesAttribute.List.class);
             if (overridesAttributeList != null) {
@@ -359,12 +354,9 @@ final class AnnotationConstraintBuilder<A extends Annotation> {
     }
 
     private ConstraintOverrides findOverride(Class<? extends Annotation> constraint, int constraintIndex) {
-        for (ConstraintOverrides each : overrides) {
-            if (each.constraintType == constraint && each.constraintIndex == constraintIndex) {
-                return each;
-            }
-        }
-        return null;
+        return overrides.stream()
+            .filter(ov -> ov.constraintType.equals(constraint) && ov.constraintIndex == constraintIndex).findFirst()
+            .orElse(null);
     }
 
     /**
@@ -381,7 +373,7 @@ final class AnnotationConstraintBuilder<A extends Annotation> {
         private ConstraintOverrides(Class<? extends Annotation> constraintType, int constraintIndex) {
             this.constraintType = constraintType;
             this.constraintIndex = constraintIndex;
-            values = new HashMap<String, Object>();
+            values = new HashMap<>();
         }
 
         @SuppressWarnings("unchecked")
@@ -392,11 +384,9 @@ final class AnnotationConstraintBuilder<A extends Annotation> {
             // And the annotation
             final Annotation originalAnnot = composite.getAnnotation();
             final AnnotationProxyBuilder<Annotation> apb = new AnnotationProxyBuilder<Annotation>(originalAnnot);
-            for (String key : values.keySet()) {
-                apb.putValue(key, values.get(key));
-            }
-            final Annotation newAnnot = apb.createAnnotation();
-            ((ConstraintValidation<Annotation>) composite).setAnnotation(newAnnot);
+            values.forEach(apb::putValue);
+
+            ((ConstraintValidation<Annotation>) composite).setAnnotation(apb.createAnnotation());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationProcessor.java b/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationProcessor.java
index 4bdb331..e61b841 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationProcessor.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/AnnotationProcessor.java
@@ -121,7 +121,7 @@ public final class AnnotationProcessor {
             if (!reflection) {
                 Collection<Annotation> annotations = prop.getFeature(JsrFeatures.Property.ANNOTATIONS_TO_PROCESS);
                 if (annotations == null) {
-                    annotations = new ArrayList<Annotation>();
+                    annotations = new ArrayList<>();
                     prop.putFeature(JsrFeatures.Property.ANNOTATIONS_TO_PROCESS, annotations);
                 }
                 annotations.add(annotation);
@@ -129,18 +129,19 @@ public final class AnnotationProcessor {
             return true;
         }
 
-        /**
+        /*
          * An annotation is considered a constraint definition if its retention
          * policy contains RUNTIME and if the annotation itself is annotated
          * with javax.validation.Constraint.
          */
         final Constraint vcAnno = annotation.annotationType().getAnnotation(Constraint.class);
         if (vcAnno != null) {
-            Class<? extends ConstraintValidator<A, ?>>[] validatorClasses;
-            validatorClasses = findConstraintValidatorClasses(annotation, vcAnno);
+            Class<? extends ConstraintValidator<A, ?>>[] validatorClasses =
+                findConstraintValidatorClasses(annotation, vcAnno);
             return applyConstraint(annotation, validatorClasses, prop, owner, access, appender);
         }
-        /**
+
+        /*
          * Multi-valued constraints: To support this requirement, the bean
          * validation provider treats regular annotations (annotations not
          * annotated by @Constraint) whose value element has a return type of an

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/CascadingPropertyValidator.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/CascadingPropertyValidator.java b/bval-jsr/src/main/java/org/apache/bval/jsr/CascadingPropertyValidator.java
index ff2e273..f183c12 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/CascadingPropertyValidator.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/CascadingPropertyValidator.java
@@ -18,7 +18,9 @@ package org.apache.bval.jsr;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.Valid;
+import javax.validation.ValidationException;
 import javax.validation.Validator;
+
 import java.util.Set;
 
 /**
@@ -30,38 +32,90 @@ import java.util.Set;
  * It should be noted that {@link Validator#validateProperty(Object, String, Class...)}
  * and {@link Validator#validateValue(Class, String, Object, Class...)} are assumed
  * semantically equivalent to calling the {@link CascadingPropertyValidator}-defined
- * methods with <code>cascade == false</code>.
+ * methods with {@code cascade == false}.
  * 
  * @version $Rev: 993539 $ $Date: 2010-09-07 16:27:50 -0500 (Tue, 07 Sep 2010) $
  */
 public interface CascadingPropertyValidator extends Validator {
 
     /**
-     * Validates all constraints placed on <code>object</code>'s
-     * <code>propertyName</code> property, with optional validation cascading.
-     * 
-     * @param <T>
-     * @param object
-     * @param propertyName
-     * @param cascade
-     * @param groups
-     * @return the resulting {@link Set} of {@link ConstraintViolation}s.
+     * {@inheritDoc} Validates all constraints placed on the property of {@code object} named {@code propertyName}.
+     *
+     * @param object       object to validate
+     * @param propertyName property to validate (i.e. field and getter constraints). Nested
+     *                     properties may be referenced (e.g. prop[2].subpropA.subpropB)
+     * @param groups       group or list of groups targeted for validation (default to
+     *                     {@link javax.validation.groups.Default})
+     * @return constraint violations or an empty {@link Set} if none
+     * @throws IllegalArgumentException if {@code object} is {@code null}, if {@code propertyName null},
+     *                                  empty or not a valid object property or if {@code null} is
+     *                                  passed to the varargs {@code groups}
+     * @throws ValidationException      if a non recoverable error happens during the validation process
+     */
+    @Override
+    default <T> Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups) {
+        return validateProperty(object, propertyName, false, groups);
+    }
+
+    /**
+     * Validates all constraints placed on the property of {@code object} named {@code propertyName}.
+     *
+     * @param object       object to validate
+     * @param propertyName property to validate (i.e. field and getter constraints). Nested
+     *                     properties may be referenced (e.g. prop[2].subpropA.subpropB)
+     * @param cascade      whether to cascade along {@link Valid} properties
+     * @param groups       group or list of groups targeted for validation (default to
+     *                     {@link javax.validation.groups.Default})
+     * @return constraint violations or an empty {@link Set} if none
+     * @throws IllegalArgumentException if {@code object} is {@code null}, if {@code propertyName null},
+     *                                  empty or not a valid object property or if {@code null} is
+     *                                  passed to the varargs {@code groups}
+     * @throws ValidationException      if a non recoverable error happens during the validation process
      */
     <T> Set<javax.validation.ConstraintViolation<T>> validateProperty(T object, String propertyName, boolean cascade,
         Class<?>... groups);
 
     /**
-     * Validates all constraints placed on <code>object</code>'s
-     * <code>propertyName</code> property, with optional validation cascading,
-     * given a hypothetical property <code>value</code>.
-     * 
-     * @param <T>
-     * @param beanType
-     * @param propertyName
-     * @param value
-     * @param cascade
-     * @param groups
-     * @return the resulting {@link Set} of {@link ConstraintViolation}s.
+     * {@inheritDoc} Validates all constraints placed on the property named {@code propertyName} of the class
+     * {@code beanType} would the property value be {@code value}.
+     * <p/>
+     * {@link ConstraintViolation} objects return {@code null} for {@link ConstraintViolation#getRootBean()} and
+     * {@link ConstraintViolation#getLeafBean()}.
+     *
+     * @param beanType     the bean type
+     * @param propertyName property to validate
+     * @param value        property value to validate
+     * @param groups       group or list of groups targeted for validation (default to
+     *                     {@link javax.validation.groups.Default})
+     * @return constraint violations or an empty {@link Set} if none
+     * @throws IllegalArgumentException if {@code beanType} is {@code null}, if
+     *                                  {@code propertyName null}, empty or not a valid object
+     *                                  property or if {@code null} is passed to the varargs {@code groups}
+     * @throws ValidationException      if a non recoverable error happens during the validation process
+     */
+    @Override
+    default <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value,
+        Class<?>... groups) {
+        return validateValue(beanType, propertyName, value, false, groups);
+    }
+
+    /**
+     * {@inheritDoc} Validates all constraints placed on the property named {@code propertyName} of the class
+     * {@code beanType} would the property value be {@code value}.
+     * <p/>
+     * {@link ConstraintViolation} objects return {@code null} for {@link ConstraintViolation#getRootBean()} and
+     * {@link ConstraintViolation#getLeafBean()}.
+     *
+     * @param beanType     the bean type
+     * @param propertyName property to validate
+     * @param value        property value to validate
+     * @param groups       group or list of groups targeted for validation (default to
+     *                     {@link javax.validation.groups.Default})
+     * @return constraint violations or an empty {@link Set} if none
+     * @throws IllegalArgumentException if {@code beanType} is {@code null}, if
+     *                                  {@code propertyName null}, empty or not a valid object
+     *                                  property or if {@code null} is passed to the varargs {@code groups}
+     * @throws ValidationException      if a non recoverable error happens during the validation process
      */
     <T> Set<javax.validation.ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value,
         boolean cascade, Class<?>... groups);

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/ConstraintValidatorIdentity.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/ConstraintValidatorIdentity.java b/bval-jsr/src/main/java/org/apache/bval/jsr/ConstraintValidatorIdentity.java
index 1092323..572c39a 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/ConstraintValidatorIdentity.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/ConstraintValidatorIdentity.java
@@ -19,6 +19,8 @@
 
 package org.apache.bval.jsr;
 
+import java.util.Objects;
+
 import javax.validation.ConstraintValidator;
 import javax.validation.Path;
 
@@ -120,12 +122,7 @@ final class ConstraintValidatorIdentity {
      */
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((this.bean == null) ? 0 : this.bean.hashCode());
-        result = prime * result + ((this.path == null) ? 0 : this.path.hashCode());
-        result = prime * result + ((this.constraintValidator == null) ? 0 : this.constraintValidator.hashCode());
-        return result;
+        return Objects.hash(bean, path, constraintValidator);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultConstraintValidatorFactory.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultConstraintValidatorFactory.java b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultConstraintValidatorFactory.java
index 4aca48a..9474705 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultConstraintValidatorFactory.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultConstraintValidatorFactory.java
@@ -32,8 +32,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
  * Description: create constraint instances with the default / no-arg constructor <br/>
  */
 public class DefaultConstraintValidatorFactory implements ConstraintValidatorFactory, Closeable {
-    private final Collection<BValExtension.Releasable<?>> releasables =
-        new CopyOnWriteArrayList<BValExtension.Releasable<?>>();
+    private final Collection<BValExtension.Releasable<?>> releasables = new CopyOnWriteArrayList<>();
     private volatile Boolean useCdi = null; // store it to avoid NoClassDefFoundError when cdi is not present (it is slow) + lazily (to wait cdi is started)
 
     /**
@@ -49,9 +48,7 @@ public class DefaultConstraintValidatorFactory implements ConstraintValidatorFac
                 if (useCdi == null) {
                     try {
                         useCdi = BValExtension.getBeanManager() != null;
-                    } catch (final NoClassDefFoundError error) {
-                        useCdi = Boolean.FALSE;
-                    } catch (final Exception e) {
+                    } catch (NoClassDefFoundError | Exception error) {
                         useCdi = Boolean.FALSE;
                     }
                 }
@@ -69,10 +66,7 @@ public class DefaultConstraintValidatorFactory implements ConstraintValidatorFac
                         return instance.getInstance();
                     }
                     throw new IllegalStateException("Can't create " + constraintClass.getName());
-                } catch (final Exception e) {
-                    return constraintClass.newInstance();
-                } catch (final NoClassDefFoundError error) {
-                    return constraintClass.newInstance();
+                } catch (Exception | NoClassDefFoundError e) {
                 }
             }
             return constraintClass.newInstance();

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java
index 8c77162..6a85a2a 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java
@@ -54,10 +54,10 @@ public class DefaultMessageInterpolator implements MessageInterpolator {
     private Locale defaultLocale;
 
     /** User specified resource bundles hashed against their locale. */
-    private final Map<Locale, ResourceBundle> userBundlesMap = new ConcurrentHashMap<Locale, ResourceBundle>();
+    private final Map<Locale, ResourceBundle> userBundlesMap = new ConcurrentHashMap<>();
 
     /** Builtin resource bundles hashed against their locale. */
-    private final Map<Locale, ResourceBundle> defaultBundlesMap = new ConcurrentHashMap<Locale, ResourceBundle>();
+    private final Map<Locale, ResourceBundle> defaultBundlesMap = new ConcurrentHashMap<>();
 
     private final MessageEvaluator evaluator;
 
@@ -83,12 +83,12 @@ public class DefaultMessageInterpolator implements MessageInterpolator {
             userBundlesMap.put(defaultLocale, resourceBundle);
         }
 
-        MessageEvaluator ev = null;
+        MessageEvaluator ev;
         try {
             ev = MessageEvaluator.class
                 .cast(getClass().getClassLoader().loadClass("org.apache.bval.el.ELFacade").newInstance());
         } catch (final Throwable e) { // can be exception or error
-            // no-op
+            ev = null;
         }
         evaluator = ev;
     }
@@ -170,47 +170,42 @@ public class DefaultMessageInterpolator implements MessageInterpolator {
      * @return the resource bundle or <code>null</code> if none is found.
      */
     private ResourceBundle getFileBasedResourceBundle(Locale locale) {
-        ResourceBundle rb = null;
+        ResourceBundle rb;
         final ClassLoader classLoader = Reflection.getClassLoader(DefaultMessageInterpolator.class);
         if (classLoader != null) {
             rb = loadBundle(classLoader, locale, USER_VALIDATION_MESSAGES + " not found by thread local classloader");
-        }
-
+        } else {
         // 2011-03-27 jw: No privileged action required.
         // A class can always access the classloader of itself and of subclasses.
-        if (rb == null) {
             rb = loadBundle(getClass().getClassLoader(), locale,
                 USER_VALIDATION_MESSAGES + " not found by validator classloader");
         }
         if (LOG_FINEST) {
-            if (rb != null) {
-                log.log(Level.FINEST, String.format("%s found", USER_VALIDATION_MESSAGES));
-            } else {
+            if (rb == null) {
                 log.log(Level.FINEST, String.format("%s not found. Delegating to %s", USER_VALIDATION_MESSAGES,
                     DEFAULT_VALIDATION_MESSAGES));
+            } else {
+                log.log(Level.FINEST, String.format("%s found", USER_VALIDATION_MESSAGES));
             }
         }
         return rb;
     }
 
     private ResourceBundle loadBundle(ClassLoader classLoader, Locale locale, String message) {
-        ResourceBundle rb = null;
         try {
-            rb = ResourceBundle.getBundle(USER_VALIDATION_MESSAGES, locale, classLoader);
+            return ResourceBundle.getBundle(USER_VALIDATION_MESSAGES, locale, classLoader);
         } catch (final MissingResourceException e) {
             log.fine(message);
         }
-        return rb;
+        return null;
     }
 
     private String replaceVariables(String message, ResourceBundle bundle, Locale locale, boolean recurse) {
         final Matcher matcher = messageParameterPattern.matcher(message);
         final StringBuffer sb = new StringBuffer(64);
-        String resolvedParameterValue;
         while (matcher.find()) {
             final String parameter = matcher.group(1);
-            resolvedParameterValue = resolveParameter(parameter, bundle, locale, recurse);
-
+            String resolvedParameterValue = resolveParameter(parameter, bundle, locale, recurse);
             matcher.appendReplacement(sb, sanitizeForAppendReplacement(resolvedParameterValue));
         }
         matcher.appendTail(sb);
@@ -242,13 +237,13 @@ public class DefaultMessageInterpolator implements MessageInterpolator {
     private String resolveParameter(String parameterName, ResourceBundle bundle, Locale locale, boolean recurse) {
         String parameterValue;
         try {
-            if (bundle != null) {
+            if (bundle == null) {
+                parameterValue = parameterName;
+            } else {
                 parameterValue = bundle.getString(removeCurlyBrace(parameterName));
                 if (recurse) {
                     parameterValue = replaceVariables(parameterValue, bundle, locale, recurse);
                 }
-            } else {
-                parameterValue = parameterName;
             }
         } catch (final MissingResourceException e) {
             // return parameter itself

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultValidationProviderResolver.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultValidationProviderResolver.java b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultValidationProviderResolver.java
index 671b0d9..e63bdf4 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultValidationProviderResolver.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultValidationProviderResolver.java
@@ -38,6 +38,11 @@ public class DefaultValidationProviderResolver implements ValidationProviderReso
     //TODO - Spec recommends caching per classloader
     private static final String SPI_CFG = "META-INF/services/javax.validation.spi.ValidationProvider";
 
+    private static ClassLoader getCurrentClassLoader() {
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
+        return cl == null ? DefaultValidationProviderResolver.class.getClassLoader() : cl;
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -46,43 +51,28 @@ public class DefaultValidationProviderResolver implements ValidationProviderReso
         List<ValidationProvider<?>> providers = new ArrayList<ValidationProvider<?>>();
         try {
             // get our classloader
-            ClassLoader cl = Thread.currentThread().getContextClassLoader();
-            if (cl == null)
-                cl = DefaultValidationProviderResolver.class.getClassLoader();
+            ClassLoader cl = getCurrentClassLoader();
             // find all service provider cfgs
             Enumeration<URL> cfgs = cl.getResources(SPI_CFG);
             while (cfgs.hasMoreElements()) {
                 final URL url = cfgs.nextElement();
-                BufferedReader br = null;
-                try {
-                    br = new BufferedReader(new InputStreamReader(url.openStream()), 256);
-                    String line = br.readLine();
-                    // cfgs may contain multiple providers and/or comments
-                    while (line != null) {
-                        line = line.trim();
-                        if (!line.startsWith("#")) {
-                            try {
-                                // try loading the specified class
-                                @SuppressWarnings("rawtypes")
-                                final Class<? extends ValidationProvider> providerType =
-                                    cl.loadClass(line).asSubclass(ValidationProvider.class);
-                                // create an instance to return
-                                providers
-                                    .add(Reflection.newInstance(providerType.asSubclass(ValidationProvider.class)));
-
-                            } catch (ClassNotFoundException e) {
-                                throw new ValidationException(
-                                    "Failed to load provider " + line + " configured in file " + url, e);
-                            }
+                try (BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()), 256)) {
+                    br.lines().filter(s -> s.charAt(0) != '#').map(String::trim).forEach(line -> {
+                        // cfgs may contain multiple providers and/or comments
+                        try {
+                            // try loading the specified class
+                            @SuppressWarnings("rawtypes")
+                            final Class<? extends ValidationProvider> providerType =
+                                cl.loadClass(line).asSubclass(ValidationProvider.class);
+                            // create an instance to return
+                            providers.add(Reflection.newInstance(providerType));
+                        } catch (ClassNotFoundException e) {
+                            throw new ValidationException(
+                                "Failed to load provider " + line + " configured in file " + url, e);
                         }
-                        line = br.readLine();
-                    }
+                    });
                 } catch (IOException e) {
                     throw new ValidationException("Error trying to read " + url, e);
-                } finally {
-                    if (br != null) {
-                        br.close();
-                    }
                 }
             }
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/GraphBeanIdentity.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/GraphBeanIdentity.java b/bval-jsr/src/main/java/org/apache/bval/jsr/GraphBeanIdentity.java
index 3ec666e..26391e6 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/GraphBeanIdentity.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/GraphBeanIdentity.java
@@ -18,6 +18,8 @@
  */
 package org.apache.bval.jsr;
 
+import java.util.Objects;
+
 /**
  * Class that stores the needed properties to avoid circular paths when
  * validating an object graph.
@@ -80,32 +82,16 @@ public class GraphBeanIdentity {
      */
     @Override
     public boolean equals(Object obj) {
-
         if (this == obj) {
             return true;
         }
-
-        if (obj == null) {
-            return false;
-        }
-
         if (!(obj instanceof GraphBeanIdentity)) {
             return false;
         }
-
         GraphBeanIdentity other = (GraphBeanIdentity) obj;
 
-        // Bean ref must be the same
-        if (this.bean != other.bean) {
-            return false;
-        }
-
-        // Group ref must be the same
-        if (this.group != other.group) {
-            return false;
-        }
-
-        return true;
+        // Bean ref must be the same; Group ref must be the same
+        return bean == other.bean && group == other.group;
     }
 
     /**
@@ -113,11 +99,7 @@ public class GraphBeanIdentity {
      */
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((this.bean == null) ? 0 : this.bean.hashCode());
-        result = prime * result + ((this.group == null) ? 0 : this.group.hashCode());
-        return result;
+        return Objects.hash(bean, group);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Group.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Group.java b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Group.java
index 4f9d10a..6a211ed 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Group.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Group.java
@@ -18,6 +18,8 @@
  */
 package org.apache.bval.jsr.groups;
 
+import java.util.Objects;
+
 import javax.validation.groups.Default;
 
 /**
@@ -52,7 +54,7 @@ public final class Group {
      */
     @Override
     public String toString() {
-        return "Group{" + "group=" + group + '}';
+        return String.format("%s{group=%s}", Group.class.getSimpleName(), group);
     }
 
     /**
@@ -71,13 +73,10 @@ public final class Group {
         if (this == o) {
             return true;
         }
-        if (o == null || getClass() != o.getClass()) {
+        if (o == null || !getClass().equals(o.getClass())) {
             return false;
         }
-
-        Group group1 = (Group) o;
-
-        return group != null ? group.equals(group1.group) : group1.group == null;
+        return Objects.equals(group, ((Group) o).group);
     }
 
     /**
@@ -85,6 +84,6 @@ public final class Group {
      */
     @Override
     public int hashCode() {
-        return (group != null ? group.hashCode() : 0);
+        return Objects.hashCode(group);
     }
 }

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupConversionDescriptorImpl.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupConversionDescriptorImpl.java b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupConversionDescriptorImpl.java
index ba3a617..6d45ced 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupConversionDescriptorImpl.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupConversionDescriptorImpl.java
@@ -26,10 +26,9 @@ public class GroupConversionDescriptorImpl implements GroupConversionDescriptor
 
     public GroupConversionDescriptorImpl(final Group from, final Group to) {
         this.from = from.getGroup();
-        if (this.from.getAnnotation(GroupSequence.class) != null) {
+        if (this.from.isAnnotationPresent(GroupSequence.class)) {
             throw new ConstraintDeclarationException("from() can't get a group sequence");
         }
-
         this.to = to.getGroup();
     }
 

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Groups.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Groups.java b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Groups.java
index 162bb66..e37b829 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Groups.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/Groups.java
@@ -29,12 +29,12 @@ import java.util.List;
  * @author Roman Stumm
  */
 public class Groups {
-    /** The list of single groups. */
-    final List<Group> groups = new LinkedList<Group>();
-
     /** The list of sequences. */
-    final List<List<Group>> sequences = new LinkedList<List<Group>>();
+    private final List<List<Group>> sequences = new LinkedList<>();
 
+    /** The list of single groups. */
+    final List<Group> groups = new LinkedList<>();
+    
     /**
      * Get the Groups.
      * @return {@link List} of {@link Group}.

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupsComputer.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupsComputer.java b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupsComputer.java
index 398d6c3..c90c1fa 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupsComputer.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/groups/GroupsComputer.java
@@ -37,7 +37,7 @@ import java.util.concurrent.ConcurrentHashMap;
  * Implementation is thread-safe.
  */
 public class GroupsComputer {
-    public static final Class<?>[] DEFAULT_GROUP = new Class<?>[] { Default.class };
+    public static final Class<?>[] DEFAULT_GROUP = { Default.class };
 
     /** The default group array used in case any of the validate methods is called without a group. */
     private static final Groups DEFAULT_GROUPS;
@@ -46,7 +46,7 @@ public class GroupsComputer {
     }
 
     /** caching resolved groups in a thread-safe map. */
-    private final Map<Class<?>, List<Group>> resolvedSequences = new ConcurrentHashMap<Class<?>, List<Group>>();
+    private final Map<Class<?>, List<Group>> resolvedSequences = new ConcurrentHashMap<>();
 
     /**
      * Compute groups from an array of group classes.
@@ -72,7 +72,7 @@ public class GroupsComputer {
      * @return {@link Groups}
      */
     protected Groups computeGroups(Collection<Class<?>> groups) {
-        if (groups == null || groups.size() == 0) {
+        if (groups == null || groups.isEmpty()) {
             throw new IllegalArgumentException("At least one group has to be specified.");
         }
 
@@ -80,9 +80,8 @@ public class GroupsComputer {
             if (clazz == null) {
                 throw new IllegalArgumentException("At least one group has to be specified.");
             }
-
             if (!clazz.isInterface()) {
-                throw new ValidationException("A group has to be an interface. " + clazz.getName() + " is not.");
+                throw new ValidationException("A group must be an interface. " + clazz.getName() + " is not.");
             }
         }
 
@@ -114,7 +113,7 @@ public class GroupsComputer {
         if (resolvedSequences.containsKey(clazz)) {
             sequence = resolvedSequences.get(clazz);
         } else {
-            sequence = resolveSequence(clazz, anno, new HashSet<Class<?>>());
+            sequence = resolveSequence(clazz, anno, new HashSet<>());
         }
         chain.insertSequence(sequence);
     }
@@ -123,10 +122,9 @@ public class GroupsComputer {
         Set<Class<?>> processedSequences) {
         if (processedSequences.contains(group)) {
             throw new GroupDefinitionException("Cyclic dependency in groups definition");
-        } else {
-            processedSequences.add(group);
         }
-        List<Group> resolvedGroupSequence = new LinkedList<Group>();
+        processedSequences.add(group);
+        List<Group> resolvedGroupSequence = new LinkedList<>();
         Class<?>[] sequenceArray = sequenceAnnotation.value();
         for (Class<?> clazz : sequenceArray) {
             GroupSequence anno = clazz.getAnnotation(GroupSequence.class);

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/parameter/DefaultParameterNameProvider.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/parameter/DefaultParameterNameProvider.java b/bval-jsr/src/main/java/org/apache/bval/jsr/parameter/DefaultParameterNameProvider.java
index 2b43bcd..dec9ae8 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/parameter/DefaultParameterNameProvider.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/parameter/DefaultParameterNameProvider.java
@@ -18,30 +18,29 @@
  */
 package org.apache.bval.jsr.parameter;
 
-import javax.validation.ParameterNameProvider;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
-import java.util.ArrayList;
+import java.lang.reflect.Parameter;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.validation.ParameterNameProvider;
 
 public class DefaultParameterNameProvider implements ParameterNameProvider {
-    private static final String ARG = "arg";
+
+    private static List<String> parameterNames(Executable exe) {
+        return Stream.of(exe.getParameters()).map(Parameter::getName).collect(Collectors.toList());
+    }
 
     @Override
     public List<String> getParameterNames(Constructor<?> constructor) {
-        return names(constructor.getParameterTypes().length);
+        return parameterNames(constructor);
     }
 
     @Override
     public List<String> getParameterNames(Method method) {
-        return names(method.getParameterTypes().length);
-    }
-
-    private static List<String> names(final int length) {
-        final List<String> list = new ArrayList<String>();
-        for (int i = 0; i < length; i++) {
-            list.add(ARG + i);
-        }
-        return list;
+        return parameterNames(method);
     }
 }

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/resolver/CachingTraversableResolver.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/resolver/CachingTraversableResolver.java b/bval-jsr/src/main/java/org/apache/bval/jsr/resolver/CachingTraversableResolver.java
index 05639c7..2f212de 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/resolver/CachingTraversableResolver.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/resolver/CachingTraversableResolver.java
@@ -21,6 +21,7 @@ import javax.validation.TraversableResolver;
 import java.lang.annotation.ElementType;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * Cache results of a delegated traversable resovler to optimize calls
@@ -34,7 +35,7 @@ import java.util.Map;
  */
 public class CachingTraversableResolver implements TraversableResolver, CachingRelevant {
     private TraversableResolver delegate;
-    private Map<CacheEntry, CacheEntry> cache = new HashMap<CacheEntry, CacheEntry>();
+    private Map<CacheEntry, CacheEntry> cache = new HashMap<>();
 
     /**
      * Convenience method to check whether caching is necessary on a given {@link TraversableResolver}.
@@ -61,11 +62,8 @@ public class CachingTraversableResolver implements TraversableResolver, CachingR
      * @see #needsCaching(TraversableResolver)
      */
     public static TraversableResolver cacheFor(TraversableResolver traversableResolver) {
-        if (needsCaching(traversableResolver)) {
-            return new CachingTraversableResolver(traversableResolver);
-        } else {
-            return traversableResolver;
-        }
+        return needsCaching(traversableResolver) ? new CachingTraversableResolver(traversableResolver)
+            : traversableResolver;
     }
 
     /**
@@ -158,15 +156,14 @@ public class CachingTraversableResolver implements TraversableResolver, CachingR
             if (this == o) {
                 return true;
             }
-            if (o == null || getClass() != o.getClass()) {
+            if (o == null || !getClass().equals(o.getClass())) {
                 return false;
             }
 
             CacheEntry that = (CacheEntry) o;
 
-            return elementType == that.elementType && path.equals(that.path) && type.equals(that.type)
-                && !(object != null ? !object.equals(that.object) : that.object != null) && node.equals(that.node);
-
+            return elementType == that.elementType && Objects.equals(path, that.path) && Objects.equals(type, that.type)
+                && Objects.equals(object, that.object) && Objects.equals(node, that.node);
         }
 
         /**
@@ -178,12 +175,7 @@ public class CachingTraversableResolver implements TraversableResolver, CachingR
         }
 
         private int buildHashCode() {
-            int result = object != null ? object.hashCode() : 0;
-            result = 31 * result + node.hashCode();
-            result = 31 * result + type.hashCode();
-            result = 31 * result + path.hashCode();
-            result = 31 * result + elementType.hashCode();
-            return result;
+            return Objects.hash(object, node, type, path, elementType);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/util/ClassHelper.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/util/ClassHelper.java b/bval-jsr/src/main/java/org/apache/bval/jsr/util/ClassHelper.java
index 9d3bd85..73c82a6 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/util/ClassHelper.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/util/ClassHelper.java
@@ -20,7 +20,11 @@ package org.apache.bval.jsr.util;
 
 import java.io.Serializable;
 import java.security.AccessController;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * Common operations on classes that do not require an {@link AccessController}.
@@ -28,6 +32,7 @@ import java.util.List;
  * @author Carlos Vara
  */
 public class ClassHelper {
+    private static final Set<Class<?>> IGNORED_TYPES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(null,Object.class,Serializable.class,Cloneable.class)));
 
     private ClassHelper() {
         // No instances please
@@ -42,10 +47,7 @@ public class ClassHelper {
      * @param clazz
      */
     public static List<Class<?>> fillFullClassHierarchyAsList(List<Class<?>> allClasses, Class<?> clazz) {
-        if (clazz == null || clazz == Object.class || clazz == Serializable.class || clazz == Cloneable.class) {
-            return allClasses;
-        }
-        if (allClasses.contains(clazz)) {
+        if (IGNORED_TYPES.contains(clazz) || allClasses.contains(clazz)) {
             return allClasses;
         }
         allClasses.add(clazz);

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/util/IOs.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/util/IOs.java b/bval-jsr/src/main/java/org/apache/bval/jsr/util/IOs.java
index 611a9d6..57f7cf4 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/util/IOs.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/util/IOs.java
@@ -33,25 +33,20 @@ public class IOs {
         if (stream == null) {
             return null;
         }
-
-        // force ByteArrayOutputStream since we close the stream ATM
-        /*if (stream.markSupported()) {
-            return stream;
-        } else {*/
-        try {
+        try (InputStream in = stream) {
             final ByteArrayOutputStream baos = new ByteArrayOutputStream();
             final byte[] buffer = new byte[1024];
             int length;
-            while ((length = stream.read(buffer)) != -1) {
+            while ((length = in.read(buffer)) != -1) {
                 baos.write(buffer, 0, length);
             }
             return new ByteArrayInputStream(baos.toByteArray());
         } catch (final IOException e) {
             throw new RuntimeException(e);
         }
-        /*}*/
     }
 
+    //TODO see if needed
     public static void closeQuietly(Closeable closeable) {
         if (closeable != null) {
             try {

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/util/PathNavigation.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/util/PathNavigation.java b/bval-jsr/src/main/java/org/apache/bval/jsr/util/PathNavigation.java
index 36fb919..9f0850e 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/util/PathNavigation.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/util/PathNavigation.java
@@ -36,7 +36,7 @@ public class PathNavigation {
     /**
      * Path traversal callback function interface.
      */
-    public interface Callback<T> {
+    interface Callback<T> {
         /**
          * Handle a .-delimited property.
          * 
@@ -67,13 +67,13 @@ public class PathNavigation {
     /**
      * Callback "procedure" that always returns null.
      */
-    public static abstract class CallbackProcedure implements Callback<Object> {
+    public static abstract class CallbackProcedure implements Callback<Void> {
 
         /**
          * {@inheritDoc}
          */
         @Override
-        public final Object result() {
+        public final Void result() {
             complete();
             return null;
         }
@@ -275,7 +275,7 @@ public class PathNavigation {
     /**
      * ParsePosition/Callback
      */
-    private static class PathPosition extends ParsePosition implements Callback<Object> {
+    private static class PathPosition extends ParsePosition implements Callback<Void> {
         final Callback<?> delegate;
 
         /**
@@ -336,7 +336,7 @@ public class PathNavigation {
          * {@inheritDoc}
          */
         @Override
-        public Object result() {
+        public Void result() {
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/bval/blob/31e1eff6/bval-jsr/src/main/java/org/apache/bval/jsr/util/Proxies.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/util/Proxies.java b/bval-jsr/src/main/java/org/apache/bval/jsr/util/Proxies.java
index 1fa033c..1d0c1ee 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/util/Proxies.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/util/Proxies.java
@@ -26,7 +26,7 @@ public final class Proxies {
     private static final Set<String> KNOWN_PROXY_CLASSNAMES;
 
     static {
-        final Set<String> s = new HashSet<String>();
+        final Set<String> s = new HashSet<>();
         s.add("org.jboss.weld.bean.proxy.ProxyObject");
         KNOWN_PROXY_CLASSNAMES = Collections.unmodifiableSet(s);
     }


Mime
View raw message