Skip to content

Commit

Permalink
AbstractArrayConverter.parseElements(String) now returns a
Browse files Browse the repository at this point in the history
List<String> instead of a raw List
  • Loading branch information
garydgregory committed Dec 26, 2024
1 parent f498c9b commit a5ef8b1
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<action type="fix" dev="ggregory" due-to="Gary Gregory">Replace Maven CLIRR plugin with JApiCmp.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Port to Java 1.4 Throwable APIs (!).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix Javadoc generation on Java 8, 17, and 21.</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">AbstractArrayConverter.parseElements(String) now returns a List&lt;String&gt; instead of a raw List.</action>
<!-- UPDATE -->
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 47 to 78.</action>
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump Java requirement from Java 6 to 8.</action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public AbstractArrayConverter(final Object defaultValue) {
* @throws NullPointerException if <code>svalue</code>
* is <code>null</code>
*/
protected List parseElements(String svalue) {
protected List<String> parseElements(String svalue) {

// Validate the passed argument
if (svalue == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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);
Expand Down

0 comments on commit a5ef8b1

Please sign in to comment.