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 fc3d14f7f7..177115ae83 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 @@ -20,7 +20,6 @@ import java.io.Serializable; import java.lang.reflect.InvocationTargetException; -import java.math.BigDecimal; import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -332,8 +331,7 @@ public static Object simpleTypeOrObjectConvert(Object obj, String type, String f if (converter != null) { // numeric types : replace everything that's not in [:IsAlnum:] or [:IsPunct:] classes by an empty string - List numericClasses = UtilMisc.toList(BigDecimal.class, Double.class, Float.class, Long.class); - if (obj instanceof String && numericClasses.contains(targetClass)) { + if (obj instanceof String && Number.class.isAssignableFrom((targetClass))) { obj = ((String) obj).replaceAll("[^\\p{IsAlnum}\\p{IsPunct}]", ""); }