You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/11/21 19:00:12 UTC

[commons-validator] branch master updated: Better number-string conversion.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git


The following commit(s) were added to refs/heads/master by this push:
     new 901179a  Better number-string conversion.
901179a is described below

commit 901179a6f7a028976f456e946a7c623c899bf183
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Nov 21 14:00:09 2020 -0500

    Better number-string conversion.
---
 src/test/java/org/apache/commons/validator/ByteTest.java    | 4 ++--
 src/test/java/org/apache/commons/validator/DoubleTest.java  | 4 ++--
 src/test/java/org/apache/commons/validator/FloatTest.java   | 4 ++--
 src/test/java/org/apache/commons/validator/IntegerTest.java | 4 ++--
 src/test/java/org/apache/commons/validator/LongTest.java    | 4 ++--
 src/test/java/org/apache/commons/validator/ShortTest.java   | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/ByteTest.java b/src/test/java/org/apache/commons/validator/ByteTest.java
index 63ac3ed..e7f5a71 100644
--- a/src/test/java/org/apache/commons/validator/ByteTest.java
+++ b/src/test/java/org/apache/commons/validator/ByteTest.java
@@ -48,7 +48,7 @@ public class ByteTest extends AbstractNumberTest {
     public void testByteMin() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Byte.valueOf(Byte.MIN_VALUE).toString());
+        info.setValue(Byte.toString(Byte.MIN_VALUE));
 
         valueTest(info, true);
     }
@@ -59,7 +59,7 @@ public class ByteTest extends AbstractNumberTest {
     public void testByteMax() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Byte.valueOf(Byte.MAX_VALUE).toString());
+        info.setValue(Byte.toString(Byte.MAX_VALUE));
 
         valueTest(info, true);
     }
diff --git a/src/test/java/org/apache/commons/validator/DoubleTest.java b/src/test/java/org/apache/commons/validator/DoubleTest.java
index 9e907ab..e1db42d 100644
--- a/src/test/java/org/apache/commons/validator/DoubleTest.java
+++ b/src/test/java/org/apache/commons/validator/DoubleTest.java
@@ -48,7 +48,7 @@ public class DoubleTest extends AbstractNumberTest {
     public void testDoubleMin() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Double.valueOf(Double.MIN_VALUE).toString());
+        info.setValue(Double.toString(Double.MIN_VALUE));
 
         valueTest(info, true);
     }
@@ -59,7 +59,7 @@ public class DoubleTest extends AbstractNumberTest {
     public void testDoubleMax() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Double.valueOf(Double.MAX_VALUE).toString());
+        info.setValue(Double.toString(Double.MAX_VALUE));
 
         valueTest(info, true);
     }
diff --git a/src/test/java/org/apache/commons/validator/FloatTest.java b/src/test/java/org/apache/commons/validator/FloatTest.java
index 8b57a27..4bbcf87 100644
--- a/src/test/java/org/apache/commons/validator/FloatTest.java
+++ b/src/test/java/org/apache/commons/validator/FloatTest.java
@@ -47,7 +47,7 @@ public class FloatTest extends AbstractNumberTest {
     public void testFloatMin() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Float.valueOf(Float.MIN_VALUE).toString());
+        info.setValue(Float.toString(Float.MIN_VALUE));
 
         valueTest(info, true);
     }
@@ -58,7 +58,7 @@ public class FloatTest extends AbstractNumberTest {
     public void testFloatMax() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Float.valueOf(Float.MAX_VALUE).toString());
+        info.setValue(Float.toString(Float.MAX_VALUE));
 
         valueTest(info, true);
     }
diff --git a/src/test/java/org/apache/commons/validator/IntegerTest.java b/src/test/java/org/apache/commons/validator/IntegerTest.java
index 14806a7..04da6a8 100644
--- a/src/test/java/org/apache/commons/validator/IntegerTest.java
+++ b/src/test/java/org/apache/commons/validator/IntegerTest.java
@@ -50,7 +50,7 @@ public class IntegerTest extends AbstractNumberTest {
     public void testIntMin() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Integer.valueOf(Integer.MIN_VALUE).toString());
+        info.setValue(Integer.toString(Integer.MIN_VALUE));
 
         valueTest(info, true);
     }
@@ -61,7 +61,7 @@ public class IntegerTest extends AbstractNumberTest {
     public void testIntegerMax() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Integer.valueOf(Integer.MAX_VALUE).toString());
+        info.setValue(Integer.toString(Integer.MAX_VALUE));
 
         valueTest(info, true);
     }
diff --git a/src/test/java/org/apache/commons/validator/LongTest.java b/src/test/java/org/apache/commons/validator/LongTest.java
index 09660af..d3f0d79 100644
--- a/src/test/java/org/apache/commons/validator/LongTest.java
+++ b/src/test/java/org/apache/commons/validator/LongTest.java
@@ -47,7 +47,7 @@ public class LongTest extends AbstractNumberTest {
     public void testLongMin() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Long.valueOf(Long.MIN_VALUE).toString());
+        info.setValue(Long.toString(Long.MIN_VALUE));
 
         valueTest(info, true);
     }
@@ -58,7 +58,7 @@ public class LongTest extends AbstractNumberTest {
     public void testLongMax() throws ValidatorException {
         // Create bean to run test on.
         ValueBean info = new ValueBean();
-        info.setValue(Long.valueOf(Long.MAX_VALUE).toString());
+        info.setValue(Long.toString(Long.MAX_VALUE));
 
         valueTest(info, true);
     }
diff --git a/src/test/java/org/apache/commons/validator/ShortTest.java b/src/test/java/org/apache/commons/validator/ShortTest.java
index d4d1015..d9f2da3 100644
--- a/src/test/java/org/apache/commons/validator/ShortTest.java
+++ b/src/test/java/org/apache/commons/validator/ShortTest.java
@@ -36,7 +36,7 @@ public class ShortTest extends AbstractNumberTest {
    public void testShortMin() throws ValidatorException {
       // Create bean to run test on.
       ValueBean info = new ValueBean();
-      info.setValue(Short.valueOf(Short.MIN_VALUE).toString());
+      info.setValue(Short.toString(Short.MIN_VALUE));
       
       valueTest(info, true);
    }
@@ -47,7 +47,7 @@ public class ShortTest extends AbstractNumberTest {
    public void testShortMax() throws ValidatorException {
       // Create bean to run test on.
       ValueBean info = new ValueBean();
-      info.setValue(Short.valueOf(Short.MAX_VALUE).toString());
+      info.setValue(Short.toString(Short.MAX_VALUE));
       
       valueTest(info, true);
    }