click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bck...@apache.org
Subject svn commit: r986270 - in /click/trunk/click: extras/src/org/apache/click/extras/control/IntegerField.java extras/src/org/apache/click/extras/control/LongField.java framework/src/org/apache/click/util/RequestTypeConverter.java
Date Tue, 17 Aug 2010 11:40:33 GMT
Author: bckfnn
Date: Tue Aug 17 11:40:33 2010
New Revision: 986270

URL: http://svn.apache.org/viewvc?rev=986270&view=rev
Log:
use XXX.valueOf(n) instead of new XXX(n) as suggested by findbugs.


Modified:
    click/trunk/click/extras/src/org/apache/click/extras/control/IntegerField.java
    click/trunk/click/extras/src/org/apache/click/extras/control/LongField.java
    click/trunk/click/framework/src/org/apache/click/util/RequestTypeConverter.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/IntegerField.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/IntegerField.java?rev=986270&r1=986269&r2=986270&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/IntegerField.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/IntegerField.java Tue Aug
17 11:40:33 2010
@@ -191,7 +191,7 @@ public class IntegerField extends Number
     public Long getLong() {
         Integer value = getInteger();
         if (value != null) {
-            return new Long(value.longValue());
+            return Long.valueOf(value.longValue());
         } else {
             return null;
         }

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/LongField.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/LongField.java?rev=986270&r1=986269&r2=986270&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/LongField.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/LongField.java Tue Aug 17
11:40:33 2010
@@ -178,7 +178,7 @@ public class LongField extends NumberFie
     public Integer getInteger() {
         Long value = getLong();
         if (value != null) {
-            return new Integer(value.intValue());
+            return Integer.valueOf(value.intValue());
         } else {
             return null;
         }

Modified: click/trunk/click/framework/src/org/apache/click/util/RequestTypeConverter.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/util/RequestTypeConverter.java?rev=986270&r1=986269&r2=986270&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/util/RequestTypeConverter.java (original)
+++ click/trunk/click/framework/src/org/apache/click/util/RequestTypeConverter.java Tue Aug
17 11:40:33 2010
@@ -95,7 +95,7 @@ public class RequestTypeConverter implem
 
             } else {
                 if ((toType == Integer.class) || (toType == Integer.TYPE)) {
-                    result = new Integer((int) OgnlOps.longValue(value));
+                    result = Integer.valueOf((int) OgnlOps.longValue(value));
 
                 } else if ((toType == Double.class) || (toType == Double.TYPE)) {
                     result = new Double(OgnlOps.doubleValue(value));
@@ -104,16 +104,16 @@ public class RequestTypeConverter implem
                     result = Boolean.valueOf(value.toString());
 
                 } else if ((toType == Byte.class) || (toType == Byte.TYPE)) {
-                    result = new Byte((byte) OgnlOps.longValue(value));
+                    result = Byte.valueOf((byte) OgnlOps.longValue(value));
 
                 } else if ((toType == Character.class) || (toType == Character.TYPE)) {
-                    result = new Character((char) OgnlOps.longValue(value));
+                    result = Character.valueOf((char) OgnlOps.longValue(value));
 
                 } else if ((toType == Short.class) || (toType == Short.TYPE)) {
-                    result = new Short((short) OgnlOps.longValue(value));
+                    result = Short.valueOf((short) OgnlOps.longValue(value));
 
                 } else if ((toType == Long.class) || (toType == Long.TYPE)) {
-                    result = new Long(OgnlOps.longValue(value));
+                    result = Long.valueOf(OgnlOps.longValue(value));
 
                 } else if ((toType == Float.class) || (toType == Float.TYPE)) {
                     result = new Float(OgnlOps.doubleValue(value));



Mime
View raw message