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

    https://github.com/apache/incubator-storm/pull/187#discussion_r14849803
  
    --- Diff: storm-core/src/jvm/backtype/storm/ConfigValidation.java ---
    @@ -82,6 +82,76 @@ public void validateField(String name, Object field)
         public static Object MapsValidator = 
FieldListValidatorFactory(Map.class);
     
         /**
    +     * Validates a Integer.
    +     */
    +    public static Object IntegerValidator = new FieldValidator() {
    +        @Override
    +        public void validateField(String name, Object o) throws 
IllegalArgumentException {
    +            if (o == null) {
    +                // A null value is acceptable.
    --- End diff --
    
    @d2r I'm not familiar with clojure, but it seems that line 51 you commented 
is about Class, not value.
    
    ````
    (defmethod get-FieldValidator Object
      [klass]
      {:pre [(not (nil? klass))]}
      (reify ConfigValidation$FieldValidator
        (validateField [this name v]
                       (if (and (not (nil? v))
                                (not (instance? klass v)))
                         (throw (IllegalArgumentException.
                                  (str "field " name " '" v "' must be a '" 
(.getName klass) "'")))))))
    ````
    
    Actually it have been allowed null value.
    It throws IllegalArgumentException when value is not null and value is not 
instance of Class.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to