[hornetq-commits] JBoss hornetq SVN: r12207 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Feb 27 15:30:28 EST 2012


Author: clebert.suconic at jboss.com
Date: 2012-02-27 15:30:27 -0500 (Mon, 27 Feb 2012)
New Revision: 12207

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/Validators.java
Log:
JBPAPP-8246 - Possible (unlikely though) NPE on validators

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/Validators.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/Validators.java	2012-02-27 15:05:24 UTC (rev 12206)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/Validators.java	2012-02-27 20:30:27 UTC (rev 12207)
@@ -69,7 +69,7 @@
       public void validate(final String name, final Object value)
       {
          Number val = (Number)value;
-         if (val != null && val.intValue() < 0 || val.intValue() > 100)
+         if (val == null || (val.intValue() < 0 || val.intValue() > 100))
          {
             throw new IllegalArgumentException(String.format("%s  must be a valid percentual value between 0 and 100 (actual value: %s)",
                                                              name,



More information about the hornetq-commits mailing list