bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1644240 - /bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/
Date Tue, 09 Dec 2014 23:49:17 GMT
Author: mbenson
Date: Tue Dec  9 23:49:17 2014
New Revision: 1644240

URL: http://svn.apache.org/r1644240
Log:
cleanup

Modified:
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertFalseValidator.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertTrueValidator.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForNumber.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForString.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForNumber.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForString.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForNumber.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForString.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MaxValidatorForNumber.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MinValidatorForNumber.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidator.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidatorForString.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/PatternValidator.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidator.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfBoolean.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfByte.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfChar.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfDouble.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfFloat.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfInt.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfLong.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfObject.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfShort.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCharSequence.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCollection.java
    bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForMap.java

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertFalseValidator.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertFalseValidator.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertFalseValidator.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertFalseValidator.java
Tue Dec  9 23:49:17 2014
@@ -31,7 +31,7 @@ public class AssertFalseValidator implem
     }
 
     public boolean isValid(Boolean value, ConstraintValidatorContext context) {
-        return value == null || !value;
+        return value == null || Boolean.FALSE.equals(value);
     }
 
 }
\ No newline at end of file

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertTrueValidator.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertTrueValidator.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertTrueValidator.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/AssertTrueValidator.java
Tue Dec  9 23:49:17 2014
@@ -31,7 +31,7 @@ public class AssertTrueValidator impleme
     }
 
     public boolean isValid(Boolean value, ConstraintValidatorContext context) {
-        return value == null || value;
+        return value == null || Boolean.TRUE.equals(value);
     }
 
 }
\ No newline at end of file

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForNumber.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForNumber.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForNumber.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForNumber.java
Tue Dec  9 23:49:17 2014
@@ -25,8 +25,7 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 
 /** Description: validate that number-value of passed object is <= maxvalue<br/>
*/
-public class DecimalMaxValidatorForNumber
-      implements ConstraintValidator<DecimalMax, Number> {
+public class DecimalMaxValidatorForNumber implements ConstraintValidator<DecimalMax, Number>
{
 
     private BigDecimal maxValue;
 
@@ -42,12 +41,13 @@ public class DecimalMaxValidatorForNumbe
     public boolean isValid(Number value, ConstraintValidatorContext context) {
         if (value == null) {
             return true;
-        } else if (value instanceof BigDecimal) {
+        }
+        if (value instanceof BigDecimal) {
             return ((BigDecimal) value).compareTo(maxValue) != 1;
-        } else if (value instanceof BigInteger) {
+        }
+        if (value instanceof BigInteger) {
             return (new BigDecimal((BigInteger) value)).compareTo(maxValue) != 1;
-        } else {
-            return (new BigDecimal(value.doubleValue()).compareTo(maxValue)) != 1;
         }
+        return (new BigDecimal(value.doubleValue()).compareTo(maxValue)) != 1;
     }           
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForString.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForString.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForString.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMaxValidatorForString.java
Tue Dec  9 23:49:17 2014
@@ -27,8 +27,7 @@ import java.math.BigDecimal;
  * Check that the String being validated represents a number, and has a value
  * <= maxvalue
  */
-public class DecimalMaxValidatorForString
-      implements ConstraintValidator<DecimalMax, String> {
+public class DecimalMaxValidatorForString implements ConstraintValidator<DecimalMax, String>
{
 
     private BigDecimal maxValue;
 
@@ -36,8 +35,7 @@ public class DecimalMaxValidatorForStrin
         try {
             this.maxValue = new BigDecimal(annotation.value());
         } catch (NumberFormatException nfe) {
-            throw new IllegalArgumentException(
-                  annotation.value() + " does not represent a valid BigDecimal format");
+            throw new IllegalArgumentException(annotation.value() + " does not represent
a valid BigDecimal format");
         }
     }
 

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForNumber.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForNumber.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForNumber.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForNumber.java
Tue Dec  9 23:49:17 2014
@@ -25,8 +25,7 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 
 /** Description: validate that number-value of passed object is >= minvalue<br/>
*/
-public class DecimalMinValidatorForNumber
-      implements ConstraintValidator<DecimalMin, Number> {
+public class DecimalMinValidatorForNumber implements ConstraintValidator<DecimalMin, Number>
{
 
     private BigDecimal minValue;
 
@@ -34,20 +33,20 @@ public class DecimalMinValidatorForNumbe
         try {
             this.minValue = new BigDecimal(annotation.value());
         } catch (NumberFormatException nfe) {
-            throw new IllegalArgumentException(
-                  annotation.value() + " does not represent a valid BigDecimal format");
+            throw new IllegalArgumentException(annotation.value() + " does not represent
a valid BigDecimal format");
         }
     }
 
     public boolean isValid(Number value, ConstraintValidatorContext context) {
         if (value == null) {
             return true;
-        } else if (value instanceof BigDecimal) {
+        }
+        if (value instanceof BigDecimal) {
             return ((BigDecimal) value).compareTo(minValue) != -1;
-        } else if (value instanceof BigInteger) {
+        }
+        if (value instanceof BigInteger) {
             return (new BigDecimal((BigInteger) value)).compareTo(minValue) != -1;
-        } else {
-            return (new BigDecimal(value.doubleValue()).compareTo(minValue)) != -1;
         }
+        return (new BigDecimal(value.doubleValue()).compareTo(minValue)) != -1;
     }
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForString.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForString.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForString.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DecimalMinValidatorForString.java
Tue Dec  9 23:49:17 2014
@@ -28,8 +28,7 @@ import java.math.BigDecimal;
  * Check that the String being validated represents a number, and has a value
  * >= minvalue
  */
-public class DecimalMinValidatorForString
-      implements ConstraintValidator<DecimalMin, String> {
+public class DecimalMinValidatorForString implements ConstraintValidator<DecimalMin, String>
{
 
     private BigDecimal minValue;
 
@@ -37,8 +36,7 @@ public class DecimalMinValidatorForStrin
         try {
             this.minValue = new BigDecimal(annotation.value());
         } catch (NumberFormatException nfe) {
-            throw new IllegalArgumentException(
-                  annotation.value() + " does not represent a valid BigDecimal format");
+            throw new IllegalArgumentException(annotation.value() + " does not represent
a valid BigDecimal format");
         }
     }
 

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForNumber.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForNumber.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForNumber.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForNumber.java
Tue Dec  9 23:49:17 2014
@@ -52,12 +52,10 @@ public class DigitsValidatorForNumber im
         this.integral = annotation.integer();
         this.fractional = annotation.fraction();
         if (integral < 0) {
-            throw new IllegalArgumentException(
-                  "The length of the integer part cannot be negative.");
+            throw new IllegalArgumentException("The length of the integer part cannot be
negative.");
         }
         if (fractional < 0) {
-            throw new IllegalArgumentException(
-                  "The length of the fraction part cannot be negative.");
+            throw new IllegalArgumentException("The length of the fraction part cannot be
negative.");
         }
     }
 
@@ -74,12 +72,11 @@ public class DigitsValidatorForNumber im
         }
         bigDecimal = bigDecimal.stripTrailingZeros();
 
-        int intLength = bigDecimal.precision() - bigDecimal.scale();
+        final int intLength = bigDecimal.precision() - bigDecimal.scale();
         if (integral >= intLength) {
             int factionLength = bigDecimal.scale() < 0 ? 0 : bigDecimal.scale();
             return fractional >= factionLength;
-        } else {
-            return false;
         }
+        return false;
     }
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForString.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForString.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForString.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/DigitsValidatorForString.java
Tue Dec  9 23:49:17 2014
@@ -52,12 +52,10 @@ public class DigitsValidatorForString im
         this.integral = annotation.integer();
         this.fractional = annotation.fraction();
         if (integral < 0) {
-            throw new IllegalArgumentException(
-                  "The length of the integer part cannot be negative.");
+            throw new IllegalArgumentException("The length of the integer part cannot be
negative.");
         }
         if (fractional < 0) {
-            throw new IllegalArgumentException(
-                  "The length of the fraction part cannot be negative.");
+            throw new IllegalArgumentException("The length of the fraction part cannot be
negative.");
         }
     }
 
@@ -67,7 +65,7 @@ public class DigitsValidatorForString im
             return true;
         }
 
-        BigDecimal bigDecimal = getBigDecimalValue(str);
+        final BigDecimal bigDecimal = getBigDecimalValue(str);
         if (bigDecimal == null) {
             return false;
         }
@@ -76,18 +74,15 @@ public class DigitsValidatorForString im
         if (integral >= intLength) {
             int factionLength = bigDecimal.scale() < 0 ? 0 : bigDecimal.scale();
             return fractional >= factionLength;
-        } else {
-            return false;
         }
+        return false;
     }
 
     private BigDecimal getBigDecimalValue(String str) {
-        BigDecimal bd;
         try {
-            bd = new BigDecimal(str);
+            return new BigDecimal(str);
         } catch (NumberFormatException nfe) {
             return null;
         }
-        return bd;
     }
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MaxValidatorForNumber.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MaxValidatorForNumber.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MaxValidatorForNumber.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MaxValidatorForNumber.java
Tue Dec  9 23:49:17 2014
@@ -39,12 +39,13 @@ public class MaxValidatorForNumber imple
     public boolean isValid(Number value, ConstraintValidatorContext context) {
         if (value == null) {
             return true;
-        } else if (value instanceof BigDecimal) {
+        }
+        if (value instanceof BigDecimal) {
             return ((BigDecimal) value).compareTo(BigDecimal.valueOf(max)) != 1;
-        } else if (value instanceof BigInteger) {
+        }
+        if (value instanceof BigInteger) {
             return ((BigInteger) value).compareTo(BigInteger.valueOf(max)) != 1;
-        } else {
-            return value.longValue() <= max;
         }
+        return value.longValue() <= max;
     }
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MinValidatorForNumber.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MinValidatorForNumber.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MinValidatorForNumber.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/MinValidatorForNumber.java
Tue Dec  9 23:49:17 2014
@@ -38,13 +38,13 @@ public class MinValidatorForNumber imple
     public boolean isValid(Number value, ConstraintValidatorContext context) {
         if (value == null) {
             return true;
-        } else if (value instanceof BigDecimal) {
+        }
+        if (value instanceof BigDecimal) {
             return ((BigDecimal) value).compareTo(BigDecimal.valueOf(minValue)) != -1;
-        } else if (value instanceof BigInteger) {
+        }
+        if (value instanceof BigInteger) {
             return ((BigInteger) value).compareTo(BigInteger.valueOf(minValue)) != -1;
-        } else {
-            return value.longValue() >= minValue;
         }
-
+        return value.longValue() >= minValue;
     }
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidator.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidator.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidator.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidator.java
Tue Dec  9 23:49:17 2014
@@ -34,23 +34,24 @@ public class NotEmptyValidator implement
     }
 
     public boolean isValid(Object value, ConstraintValidatorContext context) {
-        if (value == null) return true;
+        if (value == null) {
+            return true;
+        }
         if (value.getClass().isArray()) {
             return Array.getLength(value) > 0;
-        } else {
-            try {
-                Method isEmptyMethod = value.getClass().getMethod("isEmpty");
-                if (isEmptyMethod != null) {
-                    return !((Boolean) isEmptyMethod.invoke(value)).booleanValue();
-                }
-            } catch (IllegalAccessException iae) {
-                // do nothing
-            } catch (NoSuchMethodException nsme) {
-                // do nothing
-            } catch (InvocationTargetException ite) {
-                // do nothing
+        }
+        try {
+            final Method isEmptyMethod = value.getClass().getMethod("isEmpty");
+            if (isEmptyMethod != null) {
+                return !((Boolean) isEmptyMethod.invoke(value)).booleanValue();
             }
-            return value.toString().length() > 0;
+        } catch (IllegalAccessException iae) {
+            // do nothing
+        } catch (NoSuchMethodException nsme) {
+            // do nothing
+        } catch (InvocationTargetException ite) {
+            // do nothing
         }
+        return !value.toString().isEmpty();
     }
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidatorForString.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidatorForString.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidatorForString.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/NotEmptyValidatorForString.java
Tue Dec  9 23:49:17 2014
@@ -30,6 +30,6 @@ public class NotEmptyValidatorForString
     }
 
     public boolean isValid(String value, ConstraintValidatorContext context) {
-        return value == null || value.length() > 0;
+        return value == null || !value.isEmpty();
     }
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/PatternValidator.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/PatternValidator.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/PatternValidator.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/PatternValidator.java
Tue Dec  9 23:49:17 2014
@@ -31,7 +31,7 @@ public class PatternValidator implements
     protected java.util.regex.Pattern pattern;
 
     public void initialize(Pattern annotation) {
-        Pattern.Flag flags[] = annotation.flags();
+        final Pattern.Flag flags[] = annotation.flags();
         int intFlag = 0;
         for (Pattern.Flag flag : flags) {
             intFlag = intFlag | flag.getValue();

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidator.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidator.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidator.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidator.java
Tue Dec  9 23:49:17 2014
@@ -37,8 +37,14 @@ public abstract class SizeValidator {
     public void initialize(Size constraint) {
         min = constraint.min();
         max = constraint.max();
-        if (min < 0) throw new ValidationException("Min cannot be negative");
-        if (max < 0) throw new ValidationException("Max cannot be negative");
-        if (max < min) throw new ValidationException("Max cannot be less than Min");
+        if (min < 0) {
+            throw new ValidationException("Min cannot be negative");
+        }
+        if (max < 0) {
+            throw new ValidationException("Max cannot be negative");
+        }
+        if (max < min) {
+            throw new ValidationException("Max cannot be less than Min");
+        }
     }
 }
\ No newline at end of file

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfBoolean.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfBoolean.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfBoolean.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfBoolean.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfBoolean extends SizeValidator
-      implements ConstraintValidator<Size, boolean[]> {
+public class SizeValidatorForArrayOfBoolean extends SizeValidator implements ConstraintValidator<Size,
boolean[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfBool
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfByte.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfByte.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfByte.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfByte.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfByte extends SizeValidator
-      implements ConstraintValidator<Size, byte[]> {
+public class SizeValidatorForArrayOfByte extends SizeValidator implements ConstraintValidator<Size,
byte[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfByte
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfChar.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfChar.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfChar.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfChar.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfChar extends SizeValidator
-      implements ConstraintValidator<Size, char[]> {
+public class SizeValidatorForArrayOfChar extends SizeValidator implements ConstraintValidator<Size,
char[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfChar
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfDouble.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfDouble.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfDouble.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfDouble.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfDouble extends SizeValidator
-      implements ConstraintValidator<Size, double[]> {
+public class SizeValidatorForArrayOfDouble extends SizeValidator implements ConstraintValidator<Size,
double[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfDoub
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfFloat.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfFloat.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfFloat.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfFloat.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfFloat extends SizeValidator
-      implements ConstraintValidator<Size, float[]> {
+public class SizeValidatorForArrayOfFloat extends SizeValidator implements ConstraintValidator<Size,
float[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfFloa
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfInt.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfInt.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfInt.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfInt.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfInt extends SizeValidator
-      implements ConstraintValidator<Size, int[]> {
+public class SizeValidatorForArrayOfInt extends SizeValidator implements ConstraintValidator<Size,
int[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfInt
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfLong.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfLong.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfLong.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfLong.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfLong extends SizeValidator
-      implements ConstraintValidator<Size, long[]> {
+public class SizeValidatorForArrayOfLong extends SizeValidator implements ConstraintValidator<Size,
long[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfLong
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfObject.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfObject.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfObject.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfObject.java
Tue Dec  9 23:49:17 2014
@@ -24,8 +24,7 @@ import javax.validation.constraints.Size
 import java.lang.reflect.Array;
 
 /** Check that the length of an array is between <i>min</i> and <i>max</i>
*/
-public class SizeValidatorForArrayOfObject extends SizeValidator
-      implements ConstraintValidator<Size, Object[]> {
+public class SizeValidatorForArrayOfObject extends SizeValidator implements ConstraintValidator<Size,
Object[]> {
     /**
      * Checks the number of entries in an array.
      *
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfObje
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
     }
 

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfShort.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfShort.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfShort.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForArrayOfShort.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 import java.lang.reflect.Array;
 
-public class SizeValidatorForArrayOfShort extends SizeValidator
-      implements ConstraintValidator<Size, short[]> {
+public class SizeValidatorForArrayOfShort extends SizeValidator implements ConstraintValidator<Size,
short[]> {
 
     /**
      * Checks the number of entries in an array.
@@ -39,7 +38,7 @@ public class SizeValidatorForArrayOfShor
         if (array == null) {
             return true;
         }
-        int length = Array.getLength(array);
+        final int length = Array.getLength(array);
         return length >= min && length <= max;
 	}
 }

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCharSequence.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCharSequence.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCharSequence.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCharSequence.java
Tue Dec  9 23:49:17 2014
@@ -23,8 +23,7 @@ import javax.validation.ConstraintValida
 import javax.validation.constraints.Size;
 
 /** Check that a string's length is between min and max. */
-public class SizeValidatorForCharSequence extends SizeValidator
-      implements ConstraintValidator<Size, CharSequence> {
+public class SizeValidatorForCharSequence extends SizeValidator implements ConstraintValidator<Size,
CharSequence> {
     /**
      * Checks the length of the specified string.
      *
@@ -37,7 +36,7 @@ public class SizeValidatorForCharSequenc
         if (s == null) {
             return true;
         }
-        int length = s.length();
+        final int length = s.length();
         return length >= min && length <= max;
     }
 

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCollection.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCollection.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCollection.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForCollection.java
Tue Dec  9 23:49:17 2014
@@ -24,8 +24,7 @@ import javax.validation.constraints.Size
 import java.util.Collection;
 
 /** Check that a Collection's size is between min and max. */
-public class SizeValidatorForCollection extends SizeValidator
-      implements ConstraintValidator<Size, Collection<?>> {
+public class SizeValidatorForCollection extends SizeValidator implements ConstraintValidator<Size,
Collection<?>> {
 
     /**
      * Checks the number of entries in a map.
@@ -40,7 +39,7 @@ public class SizeValidatorForCollection
         if (collection == null) {
             return true;
         }
-        int length = collection.size();
+        final int length = collection.size();
         return length >= min && length <= max;
     }
 

Modified: bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForMap.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForMap.java?rev=1644240&r1=1644239&r2=1644240&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForMap.java
(original)
+++ bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/constraints/SizeValidatorForMap.java
Tue Dec  9 23:49:17 2014
@@ -24,8 +24,7 @@ import javax.validation.constraints.Size
 import java.util.Map;
 
 /** Check that a Map's size is between min and max. */
-public class SizeValidatorForMap extends SizeValidator
-      implements ConstraintValidator<Size, Map<?, ?>> {
+public class SizeValidatorForMap extends SizeValidator implements ConstraintValidator<Size,
Map<?, ?>> {
     /**
      * Checks the number of entries in a map.
      *
@@ -39,7 +38,7 @@ public class SizeValidatorForMap extends
         if (map == null) {
             return true;
         }
-        int size = map.size();
+        final int size = map.size();
         return size >= min && size <= max;
 	}
 



Mime
View raw message