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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]