Author: doogie
Date: Mon Mar 1 03:18:20 2010
New Revision: 917371
URL:
http://svn.apache.org/viewvc?rev=917371&view=revLog:
BUG FIX: Add support for converting to PlainString, which just calls
toString directly.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ObjectType.java
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/ObjectTypeTests.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ObjectType.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ObjectType.java?rev=917371&r1=917370&r2=917371&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ObjectType.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ObjectType.java Mon Mar 1 03:18:20 2010
@@ -480,6 +480,9 @@
type = type.substring(0, genericsStart);
}
+ if ("PlainString".equals(type)) {
+ return obj.toString();
+ }
Class<?> sourceClass = obj.getClass();
Class<?> targetClass = null;
try {
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/ObjectTypeTests.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/ObjectTypeTests.java?rev=917371&r1=917370&r2=917371&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/ObjectTypeTests.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/ObjectTypeTests.java Mon Mar 1 03:18:20 2010
@@ -185,7 +185,7 @@
}
public static void basicTest(String label, Object toConvert) throws GeneralException {
- //BUG assertEquals(label + ":PlainString", toConvert.toString(), simpleTypeConvert(toConvert, "PlainString", null, null, null, true));
+ assertEquals(label + ":PlainString", toConvert.toString(), simpleTypeConvert(toConvert, "PlainString", null, null, null, true));
assertSame(label + ":same", toConvert, simpleTypeConvert(toConvert, toConvert.getClass().getName(), null, null, null, true));
assertSame(label + ":to-Object", toConvert, simpleTypeConvert(toConvert, "Object", null, null, null, true));
assertSame(label + ":to-java.lang.Object", toConvert, simpleTypeConvert(toConvert, "java.lang.Object", null, null, null, true));