diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilGenerics.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilGenerics.java index 286a2fc071..2813d81f04 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilGenerics.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilGenerics.java @@ -35,10 +35,14 @@ public final class UtilGenerics { return (V) object; } - public static > void checkCollectionContainment(Object object, Class clz, Class type) { + public static Collection checkCollection(Object object) { + return cast(object); + } + + public static > C checkCollection(Object object, Class type) { if (object != null) { - if (!(clz.isInstance(object))) { - throw new ClassCastException("Not a " + clz.getName()); + if (!(Collection.class.isInstance(object))) { + throw new ClassCastException("Not a " + Collection.class.getName()); } int i = 0; for (Object value: (Collection) object) { @@ -48,14 +52,6 @@ public final class UtilGenerics { i++; } } - } - - public static Collection checkCollection(Object object) { - return cast(object); - } - - public static > C checkCollection(Object object, Class type) { - checkCollectionContainment(object, Collection.class, type); return cast(object); }