From 862295b0f7126268d19a7b0693b85637527a1adc Mon Sep 17 00:00:00 2001 From: Villu Ruusmann Date: Fri, 5 Apr 2024 22:40:47 +0300 Subject: [PATCH] Refactored PythonObject#getArray(String, Class) method --- .../src/main/java/org/jpmml/python/PythonObject.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pmml-python/src/main/java/org/jpmml/python/PythonObject.java b/pmml-python/src/main/java/org/jpmml/python/PythonObject.java index f30edd5..f1434cc 100644 --- a/pmml-python/src/main/java/org/jpmml/python/PythonObject.java +++ b/pmml-python/src/main/java/org/jpmml/python/PythonObject.java @@ -266,7 +266,7 @@ public HasArray getArray(String name){ throw new IllegalArgumentException("The value of \'" + ClassDictUtil.formatMember(this, name) + "\' attribute (" + ClassDictUtil.formatClass(object) + ") is not a supported array type"); } - public List getArray(String name, Class clazz){ + public List getArray(String name, Class clazz){ HasArray hasArray = getArray(name); List values = hasArray.getArrayContent(); @@ -308,9 +308,8 @@ public int[] getArrayShape(String name, int length){ return shape; } - @SuppressWarnings("unchecked") public List getBooleanArray(String name){ - return (List)getArray(name, Boolean.class); + return getArray(name, Boolean.class); } public List getIntegerArray(String name){ @@ -346,14 +345,12 @@ protected String formatMessage(Object object){ return Lists.transform(values, castFunction); } - @SuppressWarnings("unchecked") public List getObjectArray(String name){ - return (List)getArray(name, Object.class); + return getArray(name, Object.class); } - @SuppressWarnings("unchecked") public List getStringArray(String name){ - return (List)getArray(name, String.class); + return getArray(name, String.class); } public List getArray(String name, String key){