Github user Lady-Stardust commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/87#discussion_r30191540
  
    --- Diff: src/main/java/org/apache/commons/lang3/Validate.java ---
    @@ -874,7 +888,752 @@ public static void matchesPattern(final CharSequence 
input, final String pattern
                 throw new IllegalArgumentException(String.format(message, 
values));
             }
         }
    -
    +    
    +    // notNaN
    +    
//---------------------------------------------------------------------------------
    +    
    +    /**
    +     * <p>Validates that the specified argument is not {@code NaN}; 
otherwise
    +     * throwing an exception.</p>
    +     * 
    +     * <pre>Validate.notNaN(myDouble);</pre>
    +     * 
    +     * <p>The message of the exception is &quot;The validated value is not 
a 
    +     * number&quot;.</p>
    +     * 
    +     * @param value  the value to validate
    +     * @throws IllegalArgumentException if the value is not a number
    +     * @see #notNaN(double, java.lang.String, java.lang.Object...) 
    +     * 
    +     * @since 3.4
    +     */
    +    public static void notNaN(final double value) {
    +        notNaN(value, DEFAULT_NOT_NAN_EX_MESSAGE);
    +    }
    +    
    +    /**
    +     * <p>Validates that the specified argument is not {@code NaN}; 
otherwise
    +     * throwing an exception with the specified message.</p>
    +     * 
    +     * <pre>Validate.notNaN(myDouble, "The value must be a number");</pre>
    +     *
    +     * @param value  the value to validate
    +     * @param message  the {@link String#format(String, Object...)} 
exception message if invalid, not null
    +     * @param values  the optional values for the formatted exception 
message
    +     * @throws IllegalArgumentException if the value is not a number
    +     * @see #notNaN(double) 
    +     * 
    +     * @since 3.4
    +     */
    +    public static void notNaN(final double value, final String message, 
final Object... values) {
    +        if (value != value) {
    --- End diff --
    
    Okay, I wanted to avoid having more method calls as the Validate methods 
might get called often in a program.
    Should I edit it and make a new pull request? How does it work?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to