You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2022/05/06 07:12:48 UTC

[commons-imaging] 02/02: SpotBugs: Throw a IllegalArgumentException instead of a RuntimeException (as in other methods)

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

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

commit 0349d97fb06a2f7af11d1832076dddcd7e841ccc
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Fri May 6 19:00:08 2022 +1200

    SpotBugs: Throw a IllegalArgumentException instead of a RuntimeException (as in other methods)
---
 src/main/java/org/apache/commons/imaging/Imaging.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/imaging/Imaging.java b/src/main/java/org/apache/commons/imaging/Imaging.java
index a992603d..339f3c1a 100644
--- a/src/main/java/org/apache/commons/imaging/Imaging.java
+++ b/src/main/java/org/apache/commons/imaging/Imaging.java
@@ -185,7 +185,7 @@ public final class Imaging {
 
     private static boolean compareBytePair(final int[] a, final int[] b) {
         if (a.length != 2 && b.length != 2) {
-            throw new RuntimeException("Invalid Byte Pair.");
+            throw new IllegalArgumentException("Invalid Byte Pair.");
         }
         return (a[0] == b[0]) && (a[1] == b[1]);
     }