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

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

commit 5c3f9bd62cbf3e36d9189caf50b8b8a128843108
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Jun 23 08:54:40 2023 -0400

    FTPCommand.checkArray() now throws IllegalStateException
    instead of RuntimeException.
---
 src/changes/changes.xml                                  | 3 +++
 src/main/java/org/apache/commons/net/ftp/FTPCommand.java | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d051d22e..44d17ea6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -88,6 +88,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary Gregory">
         TFTPServer.setSocketTimeout() now throws IllegalArgumentException 
instead of RuntimeException.
       </action>
+      <action type="fix" dev="ggregory" due-to="Gary Gregory">
+        FTPCommand.checkArray() now throws IllegalStateException instead of 
RuntimeException.
+      </action>
       <!-- UPDATE -->
       <action type="update" dev="ggregory" due-to="Dependabot">
         Bump commons-parent from 54 to 58 #132, #137, #153.
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPCommand.java 
b/src/main/java/org/apache/commons/net/ftp/FTPCommand.java
index ecfc05dc..6d55cbab 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPCommand.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPCommand.java
@@ -141,11 +141,13 @@ public final class FTPCommand {
             "STOR", "STOU", "APPE", "ALLO", "REST", "RNFR", "RNTO", "ABOR", 
"DELE", "RMD", "MKD", "PWD", "LIST", "NLST", "SITE", "SYST", "STAT", "HELP", 
"NOOP",
             "MDTM", "FEAT", "MFMT", "EPSV", "EPRT", "MLSD", "MLST" };
 
-    // default access needed for Unit test
+    /**
+     * Default access needed for Unit test.
+     */
     static void checkArray() {
         final int expectedLength = LAST + 1;
         if (COMMANDS.length != expectedLength) {
-            throw new RuntimeException("Incorrect _commands array. Should have 
length " + expectedLength + " found " + COMMANDS.length);
+            throw new IllegalStateException("Incorrect COMMANDS array. Should 
have length " + expectedLength + " found " + COMMANDS.length);
         }
     }
 

Reply via email to