This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch 1.X
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git

commit 52cc90b80753c08706bce524f190b225d1408cfe
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Jul 25 17:19:40 2024 -0400

    Use compact array notation
    
    - No need to nest
    - Remove redundant parentheses
---
 .../beanutils/converters/FloatArrayConverter.java  | 23 ++++++++++------------
 1 file changed, 10 insertions(+), 13 deletions(-)

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 fda707cf..52b9da1f 100644
--- 
a/src/main/java/org/apache/commons/beanutils/converters/FloatArrayConverter.java
+++ 
b/src/main/java/org/apache/commons/beanutils/converters/FloatArrayConverter.java
@@ -72,7 +72,7 @@ public final class FloatArrayConverter extends 
AbstractArrayConverter {
     /**
      * <p>Model object for type comparisons.</p>
      */
-    private static final float[] MODEL = new float[0];
+    private static final float[] MODEL = {};
 
 
     // --------------------------------------------------------- Public Methods
@@ -95,15 +95,14 @@ public final class FloatArrayConverter extends 
AbstractArrayConverter {
         // Deal with a null value
         if (value == null) {
             if (useDefault) {
-                return (defaultValue);
-            } else {
-                throw new ConversionException("No value specified");
+                return defaultValue;
             }
+            throw new ConversionException("No value specified");
         }
 
         // Deal with the no-conversion-needed case
         if (MODEL.getClass() == value.getClass()) {
-            return (value);
+            return value;
         }
 
         // Deal with input value as a String array
@@ -114,13 +113,12 @@ public final class FloatArrayConverter extends 
AbstractArrayConverter {
                 for (int i = 0; i < values.length; i++) {
                     results[i] = Float.parseFloat(values[i]);
                 }
-                return (results);
+                return results;
             } catch (final Exception e) {
                 if (useDefault) {
-                    return (defaultValue);
-                } else {
-                    throw new ConversionException(value.toString(), e);
+                    return defaultValue;
                 }
+                throw new ConversionException(value.toString(), e);
             }
         }
 
@@ -132,13 +130,12 @@ public final class FloatArrayConverter extends 
AbstractArrayConverter {
             for (int i = 0; i < results.length; i++) {
                 results[i] = Float.parseFloat((String) list.get(i));
             }
-            return (results);
+            return results;
         } catch (final Exception e) {
             if (useDefault) {
-                return (defaultValue);
-            } else {
-                throw new ConversionException(value.toString(), e);
+                return defaultValue;
             }
+            throw new ConversionException(value.toString(), e);
         }
 
     }

Reply via email to