diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java
index 3a9f7b7174..83daf35321 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/PcChargeApi.java
@@ -137,7 +137,7 @@ public class PcChargeApi {
String objString = null;
try {
- objString = (String) ObjectType.simpleTypeConvert(value, "java.lang.String", null, null);
+ objString = (String) ObjectType.simpleTypeOrObjectConvert(value, "java.lang.String", null, null);
} catch (GeneralException | ClassCastException e) {
Debug.logError(e, module);
throw new IllegalArgumentException("Unable to convert value to String");
diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
index 6f5fb8c454..7708dfc1ec 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaApi.java
@@ -121,7 +121,7 @@ public class RitaApi {
String objString = null;
try {
- objString = (String) ObjectType.simpleTypeConvert(value, "java.lang.String", null, null);
+ objString = (String) ObjectType.simpleTypeOrObjectConvert(value, "java.lang.String", null, null);
} catch (GeneralException | ClassCastException e) {
Debug.logError(e, module);
throw new IllegalArgumentException("Unable to convert value to String");
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/OrderManagerEvents.java b/applications/order/src/main/java/org/apache/ofbiz/order/OrderManagerEvents.java
index e2bc8e3986..edf2bcff0b 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/OrderManagerEvents.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/OrderManagerEvents.java
@@ -185,7 +185,7 @@ public class OrderManagerEvents {
if (UtilValidate.isNotEmpty(paymentMethodAmountStr)) {
BigDecimal paymentMethodAmount = BigDecimal.ZERO;
try {
- paymentMethodAmount = (BigDecimal) ObjectType.simpleTypeConvert(paymentMethodAmountStr, "BigDecimal", null, locale);
+ paymentMethodAmount = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(paymentMethodAmountStr, "BigDecimal", null, locale);
} catch (GeneralException e) {
request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error, "OrderProblemsPaymentParsingAmount", locale));
return "error";
@@ -225,7 +225,7 @@ public class OrderManagerEvents {
if (UtilValidate.isNotEmpty(amountStr)) {
BigDecimal paymentTypeAmount = BigDecimal.ZERO;
try {
- paymentTypeAmount = (BigDecimal) ObjectType.simpleTypeConvert(amountStr, "BigDecimal", null, locale);
+ paymentTypeAmount = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(amountStr, "BigDecimal", null, locale);
} catch (GeneralException e) {
request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error, "OrderProblemsPaymentParsingAmount", locale));
return "error";
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java
index af3233ae34..f433b34eb1 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderLookupServices.java
@@ -225,7 +225,7 @@ public class OrderLookupServices {
paramList.add("minDate=" + minDate);
try {
- Object converted = ObjectType.simpleTypeConvert(minDate, "Timestamp", null, null);
+ Object converted = ObjectType.simpleTypeOrObjectConvert(minDate, "Timestamp", null, null);
if (converted != null) {
conditions.add(EntityCondition.makeCondition(dateField, EntityOperator.GREATER_THAN_EQUAL_TO, converted));
}
@@ -243,7 +243,7 @@ public class OrderLookupServices {
paramList.add("maxDate=" + maxDate);
try {
- Object converted = ObjectType.simpleTypeConvert(maxDate, "Timestamp", null, null);
+ Object converted = ObjectType.simpleTypeOrObjectConvert(maxDate, "Timestamp", null, null);
if (converted != null) {
conditions.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, converted));
}
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
index b8b1bc345e..c844d75125 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
@@ -3691,7 +3691,7 @@ public class OrderServices {
String quantityStr = itemQtyMap.get(key);
BigDecimal groupQty = BigDecimal.ZERO;
try {
- groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
+ groupQty = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(quantityStr, "BigDecimal", null, locale);
} catch (GeneralException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
@@ -3755,7 +3755,7 @@ public class OrderServices {
if (UtilValidate.isNotEmpty(priceStr)) {
BigDecimal price = null;
try {
- price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr, "BigDecimal", null, locale);
+ price = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(priceStr, "BigDecimal", null, locale);
} catch (GeneralException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
@@ -3866,7 +3866,7 @@ public class OrderServices {
String quantityStr = itemQtyMap.get(key);
BigDecimal groupQty = BigDecimal.ZERO;
try {
- groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
+ groupQty = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(quantityStr, "BigDecimal", null, locale);
} catch (GeneralException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
index 0f8d349df9..dab0506df9 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
@@ -1472,7 +1472,7 @@ public class CheckOutHelper {
}
try {
- this.cart.setShipBeforeDate(shipGroupIndex, (Timestamp) ObjectType.simpleTypeConvert(shipBeforeDate, "Timestamp", null, null));
+ this.cart.setShipBeforeDate(shipGroupIndex, (Timestamp) ObjectType.simpleTypeOrObjectConvert(shipBeforeDate, "Timestamp", null, null));
} catch (Exception e) {
errMsg = "Ship Before Date must be a valid date formed ";
result = ServiceUtil.returnError(errMsg);
@@ -1487,7 +1487,7 @@ public class CheckOutHelper {
}
try {
- this.cart.setShipAfterDate(shipGroupIndex, (Timestamp) ObjectType.simpleTypeConvert(shipAfterDate,"Timestamp", null, null));
+ this.cart.setShipAfterDate(shipGroupIndex, (Timestamp) ObjectType.simpleTypeOrObjectConvert(shipAfterDate,"Timestamp", null, null));
} catch (Exception e) {
errMsg = "Ship After Date must be a valid date formed ";
result = ServiceUtil.returnError(errMsg);
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
index 4550011ac1..38a19d10b3 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
@@ -414,7 +414,7 @@ public class ShoppingCartEvents {
reservLengthStr = (String) paramMap.remove("reservLength");
// parse the reservation Length
try {
- reservLength = (BigDecimal) ObjectType.simpleTypeConvert(reservLengthStr, "BigDecimal", null, locale);
+ reservLength = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(reservLengthStr, "BigDecimal", null, locale);
} catch (Exception e) {
Debug.logWarning(e, "Problems parsing reservation length string: "
+ reservLengthStr, module);
@@ -427,7 +427,7 @@ public class ShoppingCartEvents {
reservPersonsStr = (String) paramMap.remove("reservPersons");
// parse the number of persons
try {
- reservPersons = (BigDecimal) ObjectType.simpleTypeConvert(reservPersonsStr, "BigDecimal", null, locale);
+ reservPersons = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(reservPersonsStr, "BigDecimal", null, locale);
} catch (Exception e) {
Debug.logWarning(e, "Problems parsing reservation number of persons string: " + reservPersonsStr, module);
request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error, "OrderNumberOfPersonsShouldBeOneOrLarger", locale));
@@ -461,7 +461,7 @@ public class ShoppingCartEvents {
// parse the price
try {
- price = (BigDecimal) ObjectType.simpleTypeConvert(priceStr, "BigDecimal", null, locale);
+ price = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(priceStr, "BigDecimal", null, locale);
} catch (Exception e) {
Debug.logWarning(e, "Problems parsing price string: " + priceStr, module);
price = null;
@@ -469,7 +469,7 @@ public class ShoppingCartEvents {
// parse the quantity
try {
- quantity = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
+ quantity = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(quantityStr, "BigDecimal", null, locale);
//For quantity we should test if we allow to add decimal quantity for this product an productStore :
// if not and if quantity is in decimal format then return error.
if(! ProductWorker.isDecimalQuantityOrderAllowed(delegator, productId, cart.getProductStoreId())){
@@ -500,7 +500,7 @@ public class ShoppingCartEvents {
BigDecimal amount = null;
if (UtilValidate.isNotEmpty(selectedAmountStr)) {
try {
- amount = (BigDecimal) ObjectType.simpleTypeConvert(selectedAmountStr, "BigDecimal", null, locale);
+ amount = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(selectedAmountStr, "BigDecimal", null, locale);
} catch (Exception e) {
Debug.logWarning(e, "Problem parsing amount string: " + selectedAmountStr, module);
amount = null;
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
index 4d38b322b4..1b13c84c06 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
@@ -541,7 +541,7 @@ public class ShoppingCartHelper {
if (UtilValidate.isNotEmpty(quantStr)) {
BigDecimal quantity;
try {
- quantity = (BigDecimal) ObjectType.simpleTypeConvert(quantStr, "BigDecimal", null, cart.getLocale());
+ quantity = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(quantStr, "BigDecimal", null, cart.getLocale());
} catch (GeneralException ge) {
quantity = BigDecimal.ZERO;
}
@@ -744,12 +744,12 @@ public class ShoppingCartHelper {
}
} else if (parameterName.startsWith("reservLength")) {
if (item != null) {
- BigDecimal reservLength = (BigDecimal) ObjectType.simpleTypeConvert(quantString, "BigDecimal", null, locale);
+ BigDecimal reservLength = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(quantString, "BigDecimal", null, locale);
item.setReservLength(reservLength);
}
} else if (parameterName.startsWith("reservPersons")) {
if (item != null) {
- BigDecimal reservPersons = (BigDecimal) ObjectType.simpleTypeConvert(quantString, "BigDecimal", null, locale);
+ BigDecimal reservPersons = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(quantString, "BigDecimal", null, locale);
item.setReservPersons(reservPersons);
}
} else if (parameterName.startsWith("shipBeforeDate")) {
@@ -784,7 +784,7 @@ public class ShoppingCartHelper {
item.setItemType(quantString);
}
} else {
- quantity = (BigDecimal) ObjectType.simpleTypeConvert(quantString, "BigDecimal", null, locale);
+ quantity = (BigDecimal) ObjectType.simpleTypeOrObjectConvert(quantString, "BigDecimal", null, locale);
//For quantity we should test if we allow to add decimal quantity for this product an productStore :
// if not and if quantity is in decimal format then return error.
if (!ProductWorker.isDecimalQuantityOrderAllowed(delegator, item.getProductId(), cart.getProductStoreId()) && parameterName.startsWith("update")) {
diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/task/TaskEvents.java b/applications/order/src/main/java/org/apache/ofbiz/order/task/TaskEvents.java
index 6c5ccf3fc4..59135727d7 100644
--- a/applications/order/src/main/java/org/apache/ofbiz/order/task/TaskEvents.java
+++ b/applications/order/src/main/java/org/apache/ofbiz/order/task/TaskEvents.java
@@ -62,7 +62,7 @@ public class TaskEvents {
Locale locale = UtilHttp.getLocale(request);
try {
- fromDate = (java.sql.Timestamp) ObjectType.simpleTypeConvert(fromDateStr, "java.sql.Timestamp", null, null);
+ fromDate = (java.sql.Timestamp) ObjectType.simpleTypeOrObjectConvert(fromDateStr, "java.sql.Timestamp", null, null);
} catch (GeneralException e) {
request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderInvalidDateFormatForFromDate", locale));
return "error";
diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
index fef057a889..4196df70ce 100644
--- a/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
+++ b/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
@@ -236,7 +236,7 @@ public class ProductEvents {
if (UtilValidate.isNotEmpty(fromDateStr)) {
try {
- fromDate = (Timestamp) ObjectType.simpleTypeConvert(fromDateStr, "Timestamp", null, UtilHttp.getTimeZone(request), UtilHttp.getLocale(request), false);
+ fromDate = (Timestamp) ObjectType.simpleTypeOrObjectConvert(fromDateStr, "Timestamp", null, UtilHttp.getTimeZone(request), UtilHttp.getLocale(request), false);
} catch (Exception e) {
errMsgList.add("From Date not formatted correctly.");
}
@@ -307,7 +307,7 @@ public class ProductEvents {
if (UtilValidate.isNotEmpty(thruDateStr)) {
try {
- thruDate = (Timestamp) ObjectType.simpleTypeConvert(thruDateStr, "Timestamp", null, UtilHttp.getTimeZone(request), UtilHttp.getLocale(request), false);
+ thruDate = (Timestamp) ObjectType.simpleTypeOrObjectConvert(thruDateStr, "Timestamp", null, UtilHttp.getTimeZone(request), UtilHttp.getLocale(request), false);
} catch (Exception e) {
errMsgList.add(UtilProperties.getMessage(resource,"productevents.thru_date_not_formatted_correctly", UtilHttp.getLocale(request)));
}
diff --git a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java
index c27b7f7bb8..723779a7ff 100644
--- a/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java
+++ b/applications/workeffort/src/main/java/org/apache/ofbiz/workeffort/workeffort/ICalConverter.java
@@ -471,7 +471,7 @@ public class ICalConverter {
if (serviceMap.containsKey(modelParam.name)) {
Object value = serviceMap.get(modelParam.name);
if (UtilValidate.isNotEmpty(modelParam.type)) {
- value = ObjectType.simpleTypeConvert(value, modelParam.type, null, null, null, true);
+ value = ObjectType.simpleTypeOrObjectConvert(value, modelParam.type, null, null, null, true);
}
localMap.put(modelParam.name, value);
}
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
index bb2726ccbb..53403e7a68 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/ObjectType.java
@@ -485,14 +485,21 @@ public class ObjectType {
return isOrSubOf(objectClass, typeClass);
}
- public static Object simpleTypeConvert(Object obj, String type, String format, Locale locale, boolean noTypeFail) throws GeneralException {
- return simpleTypeConvert(obj, type, format, null, locale, noTypeFail);
+ public static Object simpleTypeOrObjectConvert(Object obj, String type, String format, Locale locale, boolean noTypeFail) throws GeneralException {
+ return simpleTypeOrObjectConvert(obj, type, format, null, locale, noTypeFail);
}
/**
- * Converts the passed object to the named simple type. Supported types
- * include: String, Boolean, Double, Float, Long, Integer, Date (java.sql.Date),
- * Time, Timestamp, TimeZone;
+ * Converts the passed object to the named type.
+ * Initially created for only simple types but actually handle more types and not all simple types.
+ * See ObjectTypeTests class for more, and (normally) up to date information
+ *
+ * Supported types:
+ * - All primitives
+ * - Simple types: String, Boolean, Double, Float, Long, Integer, BigDecimal.
+ * - Other Objects: List, Map, Set, Calendar, Date (java.sql.Date), Time, Timestamp, TimeZone, Date (util.Date and sql.Date)
+ * - Simple types (maybe) not handled: Short, BigInteger, Byte, Character, ObjectName and Void...
+ *
* @param obj Object to convert
* @param type Optional Java class name of type to convert to. A null or empty String will return the original object.
* @param format Optional (can be null) format string for Date, Time, Timestamp
@@ -504,7 +511,7 @@ public class ObjectType {
*/
@SourceMonitored
@SuppressWarnings("unchecked")
- public static Object simpleTypeConvert(Object obj, String type, String format, TimeZone timeZone, Locale locale, boolean noTypeFail) throws GeneralException {
+ public static Object simpleTypeOrObjectConvert(Object obj, String type, String format, TimeZone timeZone, Locale locale, boolean noTypeFail) throws GeneralException {
if (obj == null || UtilValidate.isEmpty(type) || "Object".equals(type) || "java.lang.Object".equals(type)) {
return obj;
}
@@ -517,7 +524,7 @@ public class ObjectType {
if ("String".equals(type) || "java.lang.String".equals(type)) {
return nodeValue;
}
- return simpleTypeConvert(nodeValue, type, format, timeZone, locale, noTypeFail);
+ return simpleTypeOrObjectConvert(nodeValue, type, format, timeZone, locale, noTypeFail);
}
int genericsStart = type.indexOf("<");
if (genericsStart != -1) {
@@ -581,8 +588,8 @@ public class ObjectType {
return obj;
}
- public static Object simpleTypeConvert(Object obj, String type, String format, Locale locale) throws GeneralException {
- return simpleTypeConvert(obj, type, format, locale, true);
+ public static Object simpleTypeOrObjectConvert(Object obj, String type, String format, Locale locale) throws GeneralException {
+ return simpleTypeOrObjectConvert(obj, type, format, locale, true);
}
public static Boolean doRealCompare(Object value1, Object value2, String operator, String type, String format,
@@ -626,7 +633,7 @@ public class ObjectType {
value2Locale = UtilMisc.parseLocale("en");
}
try {
- convertedValue2 = simpleTypeConvert(value2, type, format, value2Locale);
+ convertedValue2 = simpleTypeOrObjectConvert(value2, type, format, value2Locale);
} catch (GeneralException e) {
Debug.logError(e, module);
messages.add("Could not convert value2 for comparison: " + e.getMessage());
@@ -642,7 +649,7 @@ public class ObjectType {
Object convertedValue1 = null;
try {
- convertedValue1 = simpleTypeConvert(value1, type, format, locale);
+ convertedValue1 = simpleTypeOrObjectConvert(value1, type, format, locale);
} catch (GeneralException e) {
Debug.logError(e, module);
messages.add("Could not convert value1 for comparison: " + e.getMessage());
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java
index 7553ee3518..e0ac78be25 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilProperties.java
@@ -146,7 +146,7 @@ public final class UtilProperties implements Serializable {
return defaultNumber;
}
try {
- return (Number)(ObjectType.simpleTypeConvert(str, type, null, null));
+ return (Number)(ObjectType.simpleTypeOrObjectConvert(str, type, null, null));
} catch (GeneralException e) {
Debug.logWarning("Error converting String \"" + str + "\" to " + type + "; using defaultNumber " + defaultNumber + ".", module);
}
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java
index 03f4a950e9..232db797ec 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/string/FlexibleStringExpander.java
@@ -439,7 +439,7 @@ public abstract class FlexibleStringExpander implements Serializable, IsEmpty {
if (obj instanceof String) {
buffer.append(obj);
} else {
- buffer.append(ObjectType.simpleTypeConvert(obj, "String", null, timeZone, locale, true));
+ buffer.append(ObjectType.simpleTypeOrObjectConvert(obj, "String", null, timeZone, locale, true));
}
}
} catch (GeneralException | RuntimeException e) {
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/test/ObjectTypeTests.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/test/ObjectTypeTests.java
index 9afacf661e..e626788c2d 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/test/ObjectTypeTests.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/test/ObjectTypeTests.java
@@ -96,7 +96,7 @@ public class ObjectTypeTests extends GenericTestCaseBase {
}
public static Object simpleTypeConvert(Object obj, String type, String format, TimeZone timeZone, Locale locale, boolean noTypeFail) throws GeneralException {
- return ObjectType.simpleTypeConvert(obj, type, format, timeZone, locale, noTypeFail);
+ return ObjectType.simpleTypeOrObjectConvert(obj, type, format, timeZone, locale, noTypeFail);
}
public static void simpleTypeConvertTest(String label, Object toConvert, String type, Object wanted) throws GeneralException {
@@ -249,7 +249,7 @@ public class ObjectTypeTests extends GenericTestCaseBase {
public void testClassNotFound() {
GeneralException caught = null;
try {
- ObjectType.simpleTypeConvert(this, "foobarbaz", null, null, null, false);
+ ObjectType.simpleTypeOrObjectConvert(this, "foobarbaz", null, null, null, false);
} catch (GeneralException e) {
caught = e;
} finally {
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java
index 84338e8322..f6e1dfa8c2 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java
@@ -485,7 +485,7 @@ public class GenericEntity implements Map, LocalizedMap