Author: doogie
Date: Mon Mar 1 05:06:16 2010
New Revision: 917376
URL:
http://svn.apache.org/viewvc?rev=917376&view=revLog:
BUG FIX: Move the check that tests whether we are converting to the
passed object to before the loadClass call.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ObjectType.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=917376&r1=917375&r2=917376&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 05:06:16 2010
@@ -484,6 +484,9 @@
return obj.toString();
}
Class<?> sourceClass = obj.getClass();
+ if (sourceClass.getName().equals(type)) {
+ return obj;
+ }
if ("Object".equals(type) || "java.lang.Object".equals(type)) {
return obj;
}
@@ -496,9 +499,6 @@
} catch (ClassNotFoundException e) {
throw new GeneralException("Conversion from " + sourceClass.getName() + " to " + type + " not currently supported", e);
}
- if (sourceClass.equals(targetClass)) {
- return obj;
- }
Converter<Object,Object> converter = null;
try {
converter = (Converter<Object, Object>) Converters.getConverter(sourceClass, targetClass);