Github user solomax commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/246#discussion_r151861578
  
    --- Diff: 
wicket-bean-validation/src/main/java/org/apache/wicket/bean/validation/PropertyValidator.java
 ---
    @@ -208,24 +206,29 @@ public void detach(Component component)
     
        boolean isRequired()
        {
    -           List<NotNull> constraints = findNotNullConstraints();
    +           BeanValidationContext config = 
BeanValidationConfiguration.get();
    +           List<Class<? extends Annotation>> notNullAnnotations = 
config.getNotNullAnnotations();
    +           Map<Annotation, ConstraintDescriptor<?>> constraints = 
findNotNullConstraints(
    +                   notNullAnnotations);
     
                if (constraints.isEmpty())
                {
                        return false;
                }
     
    -           HashSet<Class<?>> validatorGroups = new HashSet<Class<?>>();
    +           Set<Class<?>> validatorGroups = new HashSet<>();
                validatorGroups.addAll(Arrays.asList(getGroups()));
     
    -           for (NotNull constraint : constraints)
    +           for (Map.Entry<Annotation, ConstraintDescriptor<?>> entry : 
constraints.entrySet())
                {
    -                   if (canApplyToDefaultGroup(constraint) && 
validatorGroups.isEmpty())
    +                   final Annotation annotation = entry.getKey();
    +                   ConstraintDescriptor<?> constraintDescriptor = 
constraints.get(annotation);
    --- End diff --
    
    you can use `entry.getValue()` here


---

Reply via email to