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-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new 45080be  Fix inconsistent @throws comments in ListOrderedSet (#125)
45080be is described below

commit 45080bed9948079bdff761da4617973aa79f2de4
Author: Chen <50514813+dot...@users.noreply.github.com>
AuthorDate: Tue Dec 10 00:06:51 2019 +0800

    Fix inconsistent @throws comments in ListOrderedSet (#125)
    
    * Fix inconsistent @throws comments in ListOrderedSet
    
    * Fix inconsistent @throws comments in MultiKey and update the test cases 
for them.
---
 .../java/org/apache/commons/collections4/keyvalue/MultiKey.java     | 6 +++---
 .../java/org/apache/commons/collections4/set/ListOrderedSet.java    | 2 +-
 .../java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java 
b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
index 1df58fc..05c6f0e 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/MultiKey.java
@@ -126,7 +126,7 @@ public class MultiKey<K> implements Serializable {
      * This is equivalent to <code>new MultiKey(keys, true)</code>.
      *
      * @param keys  the array of keys, not null
-     * @throws IllegalArgumentException if the key array is null
+     * @throws NullPointerException if the key array is null
      */
     public MultiKey(final K[] keys) {
         this(keys, true);
@@ -153,13 +153,13 @@ public class MultiKey<K> implements Serializable {
      *
      * @param keys  the array of keys, not null
      * @param makeClone  true to clone the array, false to assign it
-     * @throws IllegalArgumentException if the key array is null
+     * @throws NullPointerException if the key array is null
      * @since 3.1
      */
     public MultiKey(final K[] keys, final boolean makeClone) {
         super();
         if (keys == null) {
-            throw new IllegalArgumentException("The array of keys must not be 
null");
+            throw new NullPointerException("The array of keys must not be 
null");
         }
         if (makeClone) {
             this.keys = keys.clone();
diff --git 
a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java 
b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java
index ea0db4e..c6c8a8b 100644
--- a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java
+++ b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java
@@ -147,7 +147,7 @@ public class ListOrderedSet<E>
      * Constructor that wraps (not copies).
      *
      * @param set the set to decorate, must not be null
-     * @throws IllegalArgumentException if set is null
+     * @throws NullPointerException if set is null
      */
     protected ListOrderedSet(final Set<E> set) {
         super(set);
diff --git 
a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java 
b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
index 027dbd5..fdff03d 100644
--- a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
+++ b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
@@ -96,15 +96,15 @@ public class MultiKeyTest {
         try {
             new MultiKey<>(keys);
             fail();
-        } catch (final IllegalArgumentException ex) {}
+        } catch (final NullPointerException ex) {}
         try {
             new MultiKey<>(keys, true);
             fail();
-        } catch (final IllegalArgumentException ex) {}
+        } catch (final NullPointerException ex) {}
         try {
             new MultiKey<>(keys, false);
             fail();
-        } catch (final IllegalArgumentException ex) {}
+        } catch (final NullPointerException ex) {}
     }
 
     @Test

Reply via email to