From a5ef8b10dab18bcf87c4013c098c99df046be5eb Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Thu, 26 Dec 2024 09:16:19 -0500 Subject: [PATCH] AbstractArrayConverter.parseElements(String) now returns a List<String> instead of a raw List --- src/changes/changes.xml | 1 + .../commons/beanutils/converters/AbstractArrayConverter.java | 2 +- .../commons/beanutils/converters/BooleanArrayConverter.java | 2 +- .../apache/commons/beanutils/converters/ByteArrayConverter.java | 2 +- .../commons/beanutils/converters/CharacterArrayConverter.java | 2 +- .../commons/beanutils/converters/DoubleArrayConverter.java | 2 +- .../commons/beanutils/converters/FloatArrayConverter.java | 2 +- .../commons/beanutils/converters/IntegerArrayConverter.java | 2 +- .../apache/commons/beanutils/converters/LongArrayConverter.java | 2 +- .../commons/beanutils/converters/ShortArrayConverter.java | 2 +- .../commons/beanutils/converters/StringArrayConverter.java | 2 +- 11 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2ee7dd75a..eb51f6c15 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -35,6 +35,7 @@ Replace Maven CLIRR plugin with JApiCmp. Port to Java 1.4 Throwable APIs (!). Fix Javadoc generation on Java 8, 17, and 21. + AbstractArrayConverter.parseElements(String) now returns a List<String> instead of a raw List. Bump org.apache.commons:commons-parent from 47 to 78. Bump Java requirement from Java 6 to 8. diff --git a/src/main/java/org/apache/commons/beanutils/converters/AbstractArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/AbstractArrayConverter.java index ddea6f013..b1838b87a 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/AbstractArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/AbstractArrayConverter.java @@ -152,7 +152,7 @@ public AbstractArrayConverter(final Object defaultValue) { * @throws NullPointerException if svalue * is null */ - protected List parseElements(String svalue) { + protected List parseElements(String svalue) { // Validate the passed argument if (svalue == null) { diff --git a/src/main/java/org/apache/commons/beanutils/converters/BooleanArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/BooleanArrayConverter.java index a60ed5651..38f773e4b 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/BooleanArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/BooleanArrayConverter.java @@ -216,7 +216,7 @@ public Object convert(final Class type, final Object value) { // sequence of values; see method AbstractArrayConverter.parseElements // for more information. try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final boolean[] results = new boolean[list.size()]; for (int i = 0; i < results.length; i++) { final String stringValue = (String) list.get(i); diff --git a/src/main/java/org/apache/commons/beanutils/converters/ByteArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/ByteArrayConverter.java index 3197d8693..b861dfa74 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/ByteArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/ByteArrayConverter.java @@ -122,7 +122,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final byte[] results = new byte[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = Byte.parseByte((String) list.get(i)); diff --git a/src/main/java/org/apache/commons/beanutils/converters/CharacterArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/CharacterArrayConverter.java index cab2d620d..dce6a9973 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/CharacterArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/CharacterArrayConverter.java @@ -122,7 +122,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final char[] results = new char[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = ((String) list.get(i)).charAt(0); diff --git a/src/main/java/org/apache/commons/beanutils/converters/DoubleArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/DoubleArrayConverter.java index 7061d217e..f0d70d5c4 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/DoubleArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/DoubleArrayConverter.java @@ -122,7 +122,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final double[] results = new double[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = Double.parseDouble((String) list.get(i)); diff --git a/src/main/java/org/apache/commons/beanutils/converters/FloatArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/FloatArrayConverter.java index be3eedb7d..9b4179e54 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/FloatArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/FloatArrayConverter.java @@ -122,7 +122,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final float[] results = new float[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = Float.parseFloat((String) list.get(i)); diff --git a/src/main/java/org/apache/commons/beanutils/converters/IntegerArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/IntegerArrayConverter.java index 673fe4f80..1fdcf2e03 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/IntegerArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/IntegerArrayConverter.java @@ -122,7 +122,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final int[] results = new int[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = Integer.parseInt((String) list.get(i)); diff --git a/src/main/java/org/apache/commons/beanutils/converters/LongArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/LongArrayConverter.java index b51c1e9f2..9d85f352e 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/LongArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/LongArrayConverter.java @@ -122,7 +122,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final long[] results = new long[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = Long.parseLong((String) list.get(i)); diff --git a/src/main/java/org/apache/commons/beanutils/converters/ShortArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/ShortArrayConverter.java index cc2a2accf..29a716987 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/ShortArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/ShortArrayConverter.java @@ -122,7 +122,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final short[] results = new short[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = Short.parseShort((String) list.get(i)); diff --git a/src/main/java/org/apache/commons/beanutils/converters/StringArrayConverter.java b/src/main/java/org/apache/commons/beanutils/converters/StringArrayConverter.java index 73c01f5b7..099b37afc 100644 --- a/src/main/java/org/apache/commons/beanutils/converters/StringArrayConverter.java +++ b/src/main/java/org/apache/commons/beanutils/converters/StringArrayConverter.java @@ -148,7 +148,7 @@ public Object convert(final Class type, final Object value) { // Parse the input value as a String into elements // and convert to the appropriate type try { - final List list = parseElements(value.toString()); + final List list = parseElements(value.toString()); final String[] results = new String[list.size()]; for (int i = 0; i < results.length; i++) { results[i] = (String) list.get(i);