commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r552283 - /jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java
Date Sun, 01 Jul 2007 11:27:11 GMT
Author: niallp
Date: Sun Jul  1 04:27:10 2007
New Revision: 552283

URL: http://svn.apache.org/viewvc?view=rev&rev=552283
Log:
BEANUTILS-285 - revert Martin's change (revision 552049) - ConvertUtils's convert(Object)
method has been reverted to that of the BeanUtils 1.7.0 release

Modified:
    jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java

Modified: jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java?view=diff&rev=552283&r1=552282&r2=552283
==============================================================================
--- jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java
(original)
+++ jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java
Sun Jul  1 04:27:10 2007
@@ -42,42 +42,12 @@
       */
     public String objectToString(Object object, Class type, String flavour, Context context)
{
         if ( object != null ) {
-            String text = convertInternal( object );
+            String text = ConvertUtils.convert( object );
             if ( text != null ) {
                 return text;
             }
         }
         return "";
-    }
-    
-    /**
-     * Contains the code from the beanutils 1.7.0 ConvertUtils.convert( Object )
-     * This is to prevent backward compatibility issues, which cannot be solved
-     * in beanutils because of evolving functionality.<br/>
-     * Since the advise here is the override the objectToString methods anyway
-     * people can choose themselves to adhere to the new beanutils functionality.
-     * 
-     * @param value the value to convert to a String
-     * @return the String representation or null.
-     */
-    private String convertInternal( Object value ) {
-        if (value == null) {
-            return ((String) null);
-        } else if (value.getClass().isArray()) {
-            if (Array.getLength(value) < 1) {
-                return (null);
-            }
-            value = Array.get(value, 0);
-            if (value == null) {
-                return ((String) null);
-            } else {
-                Converter converter = ConvertUtils.lookup(String.class);
-                return ((String) converter.convert(String.class, value));
-            }
-        } else {
-            Converter converter = ConvertUtils.lookup(String.class);
-            return ((String) converter.convert(String.class, value));
-        }
     }
     
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message