From 4cfdc239bcdcf8841f7ef0117508902cba9ddc7f Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 17 Dec 2013 12:40:46 -0800 Subject: [PATCH] Adjusted JavaDocs. --- .../cdt/core/parser/util/CollectionUtils.java | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java index c4df0f61692..aa1587d1349 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CollectionUtils.java @@ -34,7 +34,7 @@ public final class CollectionUtils { * The remove() method is not implemented and will throw UnsupportedOperationException. * The returned iterator does not support the remove() method. * - * @throws NullPointerException if list is null + * @throws NullPointerException if list is {@code null} */ public static Iterator reverseIterator(final List list) { return new Iterator() { @@ -56,11 +56,13 @@ public final class CollectionUtils { } /** - * Allows a foreach loop to iterate backwards over a list - * from the end to the start. + * Allows a foreach loop to iterate backwards over a list from the end to the start. * - * e.g. - * for(Object o : reverseIterable(list)) { ... } + *

+ * Example use: + *

+	 *     for (Object o : reverseIterable(list)) { ... }
+	 * 
* * @throws NullPointerException if list is null */ @@ -69,18 +71,17 @@ public final class CollectionUtils { } /** - * Creates an Iterable instance that just returns - * the given Iterator from its iterator() method. + * Creates an Iterable instance that just returns the given Iterator from its iterator() method. * * This is useful for using an iterator in a foreach loop directly. * - * e.g. + *

+ * Example use: + *

+	 *     for (Object o : iterable(iterator)) { ... }
+	 * 
* - * for(Object o : iterable(list.listIterator())) { - * // do something - * } - * - * @throws NullPointerException if list is null + * @throws NullPointerException if list is {@code null} */ public static Iterable iterable(final Iterator iter) { if (iter == null) @@ -101,7 +102,8 @@ public final class CollectionUtils { * unmodified and null is returned. * * @throws NullPointerException if list or clazz is null - * @throws UnsupportedOperationException if the list's Iterator does not support the remove() method + * @throws UnsupportedOperationException if the list's Iterator does not support the remove() + * method */ @SuppressWarnings("unchecked") public static T findFirstAndRemove(List list, Class clazz) { @@ -137,9 +139,8 @@ public final class CollectionUtils { } /** - * Gets a List corresponding to a T in a Map>. - * If the mapping doesn't exist, create it, with the empty - * list as the initial value. + * Returns a List corresponding to a T in a Map>. If the mapping doesn't exist, + * creates it with an empty list as the initial value. * @since 5.6 */ static public List listMapGet(Map> m, T t) {