From 7f0185bd3d44b9e1b2439d6685a418e7a91cac7a Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Tue, 7 Jun 2016 00:40:18 +0000 Subject: [PATCH] Update old school @exception with new school @throws. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/branches/COLLECTIONS_3_2_X@1747099 13f79535-47bb-0310-9956-ffa450edef68 --- .../collections/CursorableLinkedList.java | 2 +- .../commons/collections/FastArrayList.java | 22 +++++++++---------- .../comparators/ComparatorChain.java | 4 ++-- .../comparators/NullComparator.java | 4 ++-- .../iterators/EnumerationIterator.java | 4 ++-- .../collections/AbstractTestObject.java | 12 +++++----- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/java/org/apache/commons/collections/CursorableLinkedList.java b/src/java/org/apache/commons/collections/CursorableLinkedList.java index bc420ca37..1d3b12b4f 100644 --- a/src/java/org/apache/commons/collections/CursorableLinkedList.java +++ b/src/java/org/apache/commons/collections/CursorableLinkedList.java @@ -664,7 +664,7 @@ public class CursorableLinkedList implements List, Serializable { * be stored, if it is big enough; otherwise, a new array of the * same runtime type is allocated for this purpose. * @return an array containing the elements of this list. - * @exception ArrayStoreException + * @throws ArrayStoreException * if the runtime type of the specified array * is not a supertype of the runtime type of every element in * this list. diff --git a/src/java/org/apache/commons/collections/FastArrayList.java b/src/java/org/apache/commons/collections/FastArrayList.java index 4b11bc420..2bee77057 100644 --- a/src/java/org/apache/commons/collections/FastArrayList.java +++ b/src/java/org/apache/commons/collections/FastArrayList.java @@ -178,7 +178,7 @@ public class FastArrayList extends ArrayList { * @param index Index at which to insert this element * @param element The element to be inserted * - * @exception IndexOutOfBoundsException if the index is out of range + * @throws IndexOutOfBoundsException if the index is out of range */ public void add(int index, Object element) { @@ -230,7 +230,7 @@ public class FastArrayList extends ArrayList { * @param index Index at which insertion takes place * @param collection The collection to be added * - * @exception IndexOutOfBoundsException if the index is out of range + * @throws IndexOutOfBoundsException if the index is out of range */ public boolean addAll(int index, Collection collection) { @@ -254,7 +254,7 @@ public class FastArrayList extends ArrayList { * Remove all of the elements from this list. The list will be empty * after this call returns. * - * @exception UnsupportedOperationException if clear() + * @throws UnsupportedOperationException if clear() * is not supported by this list */ public void clear() { @@ -405,7 +405,7 @@ public class FastArrayList extends ArrayList { * * @param index The index of the element to return * - * @exception IndexOutOfBoundsException if the index is out of range + * @throws IndexOutOfBoundsException if the index is out of range */ public Object get(int index) { @@ -576,7 +576,7 @@ public class FastArrayList extends ArrayList { * * @param index The starting position of the iterator to return * @return the list iterator - * @exception IndexOutOfBoundsException if the index is out of range + * @throws IndexOutOfBoundsException if the index is out of range */ public ListIterator listIterator(int index) { if (fast) { @@ -593,7 +593,7 @@ public class FastArrayList extends ArrayList { * * @param index Index of the element to be removed * - * @exception IndexOutOfBoundsException if the index is out of range + * @throws IndexOutOfBoundsException if the index is out of range */ public Object remove(int index) { @@ -643,7 +643,7 @@ public class FastArrayList extends ArrayList { * * @param collection Collection containing elements to be removed * - * @exception UnsupportedOperationException if this optional operation + * @throws UnsupportedOperationException if this optional operation * is not supported by this list */ public boolean removeAll(Collection collection) { @@ -670,7 +670,7 @@ public class FastArrayList extends ArrayList { * * @param collection Collection containing elements to be retained * - * @exception UnsupportedOperationException if this optional operation + * @throws UnsupportedOperationException if this optional operation * is not supported by this list */ public boolean retainAll(Collection collection) { @@ -702,7 +702,7 @@ public class FastArrayList extends ArrayList { * @param index Index of the element to replace * @param element The new element to be stored * - * @exception IndexOutOfBoundsException if the index is out of range + * @throws IndexOutOfBoundsException if the index is out of range */ public Object set(int index, Object element) { @@ -743,7 +743,7 @@ public class FastArrayList extends ArrayList { * @param fromIndex The starting index of the sublist view * @param toIndex The index after the end of the sublist view * - * @exception IndexOutOfBoundsException if an index is out of range + * @throws IndexOutOfBoundsException if an index is out of range */ public List subList(int fromIndex, int toIndex) { if (fast) { @@ -780,7 +780,7 @@ public class FastArrayList extends ArrayList { * * @param array Array defining the element type of the returned list * - * @exception ArrayStoreException if the runtime type of array + * @throws ArrayStoreException if the runtime type of array * is not a supertype of the runtime type of every element in this list */ public Object[] toArray(Object array[]) { diff --git a/src/java/org/apache/commons/collections/comparators/ComparatorChain.java b/src/java/org/apache/commons/collections/comparators/ComparatorChain.java index 93fbf2fb9..ddc0cce5d 100644 --- a/src/java/org/apache/commons/collections/comparators/ComparatorChain.java +++ b/src/java/org/apache/commons/collections/comparators/ComparatorChain.java @@ -168,7 +168,7 @@ public class ComparatorChain implements Comparator, Serializable { * * @param index index of the Comparator to replace * @param comparator Comparator to place at the given index - * @exception IndexOutOfBoundsException + * @throws IndexOutOfBoundsException * if index < 0 or index >= size() */ public void setComparator(int index, Comparator comparator) @@ -260,7 +260,7 @@ public class ComparatorChain implements Comparator, Serializable { * @param o1 the first object to compare * @param o2 the second object to compare * @return -1, 0, or 1 - * @exception UnsupportedOperationException + * @throws UnsupportedOperationException * if the ComparatorChain does not contain at least one * Comparator */ diff --git a/src/java/org/apache/commons/collections/comparators/NullComparator.java b/src/java/org/apache/commons/collections/comparators/NullComparator.java index d52c6db3e..c0975e188 100644 --- a/src/java/org/apache/commons/collections/comparators/NullComparator.java +++ b/src/java/org/apache/commons/collections/comparators/NullComparator.java @@ -65,7 +65,7 @@ public class NullComparator implements Comparator, Serializable { * non-null objects. This argument cannot be * null * - * @exception NullPointerException if nonNullComparator is + * @throws NullPointerException if nonNullComparator is * null **/ public NullComparator(Comparator nonNullComparator) { @@ -104,7 +104,7 @@ public class NullComparator implements Comparator, Serializable { * that null should be compared as lower than a * non-null object. * - * @exception NullPointerException if nonNullComparator is + * @throws NullPointerException if nonNullComparator is * null **/ public NullComparator(Comparator nonNullComparator, boolean nullsAreHigh) { diff --git a/src/java/org/apache/commons/collections/iterators/EnumerationIterator.java b/src/java/org/apache/commons/collections/iterators/EnumerationIterator.java index f18f978d3..e91a05856 100644 --- a/src/java/org/apache/commons/collections/iterators/EnumerationIterator.java +++ b/src/java/org/apache/commons/collections/iterators/EnumerationIterator.java @@ -103,8 +103,8 @@ public class EnumerationIterator implements Iterator { * If so, the first occurrence of the last returned object from this * iterator will be removed from the collection. * - * @exception IllegalStateException next() not called. - * @exception UnsupportedOperationException if no associated collection + * @throws IllegalStateException next() not called. + * @throws UnsupportedOperationException if no associated collection */ public void remove() { if (collection != null) { diff --git a/src/test/org/apache/commons/collections/AbstractTestObject.java b/src/test/org/apache/commons/collections/AbstractTestObject.java index 41647af42..42d81d5ae 100644 --- a/src/test/org/apache/commons/collections/AbstractTestObject.java +++ b/src/test/org/apache/commons/collections/AbstractTestObject.java @@ -259,7 +259,7 @@ public abstract class AbstractTestObject extends BulkTest { * * @param o Object to serialize * @param path path to write the serialized Object - * @exception IOException + * @throws IOException */ protected void writeExternalFormToDisk(Serializable o, String path) throws IOException { FileOutputStream fileStream = new FileOutputStream(path); @@ -272,7 +272,7 @@ public abstract class AbstractTestObject extends BulkTest { * * @param o Object to convert to bytes * @return serialized form of the Object - * @exception IOException + * @throws IOException */ protected byte[] writeExternalFormToBytes(Serializable o) throws IOException { ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); @@ -287,8 +287,8 @@ public abstract class AbstractTestObject extends BulkTest { * * @param path path to the serialized Object * @return the Object at the given path - * @exception IOException - * @exception ClassNotFoundException + * @throws IOException + * @throws ClassNotFoundException */ protected Object readExternalFormFromDisk(String path) throws IOException, ClassNotFoundException { FileInputStream stream = new FileInputStream(path); @@ -301,8 +301,8 @@ public abstract class AbstractTestObject extends BulkTest { * * @param b byte array containing a serialized Object * @return Object contained in the bytes - * @exception IOException - * @exception ClassNotFoundException + * @throws IOException + * @throws ClassNotFoundException */ protected Object readExternalFormFromBytes(byte[] b) throws IOException, ClassNotFoundException { ByteArrayInputStream stream = new ByteArrayInputStream(b);