struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grobme...@apache.org
Subject svn commit: r1520015 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java
Date Wed, 04 Sep 2013 13:20:34 GMT
Author: grobmeier
Date: Wed Sep  4 13:20:34 2013
New Revision: 1520015

URL: http://svn.apache.org/r1520015
Log:
removed unnecessary boxing, null check was always true

Modified:
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java?rev=1520015&r1=1520014&r2=1520015&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java
(original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java
Wed Sep  4 13:20:34 2013
@@ -144,7 +144,7 @@ public class XWorkBasicConverter extends
     private Object doConvertToCharacter(Object value) {
         if (value instanceof String) {
             String cStr = (String) value;
-            return (cStr.length() > 0) ? new Character(cStr.charAt(0)) : null;
+            return (cStr.length() > 0) ? cStr.charAt(0) : null;
         }
         return null;
     }
@@ -159,7 +159,7 @@ public class XWorkBasicConverter extends
 
     private Class doConvertToClass(Object value) {
         Class clazz = null;
-        if (value instanceof String && value != null && ((String) value).length()
> 0) {
+        if (value != null && value instanceof String && ((String) value).length()
> 0) {
             try {
                 clazz = Class.forName((String) value);
             } catch (ClassNotFoundException e) {



Mime
View raw message