Apply generics

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@829343 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2009-10-24 11:08:52 +00:00
parent 4f9c1c3777
commit 58bf5f3aa3
1 changed files with 4 additions and 4 deletions

View File

@ -487,7 +487,7 @@ public class Validate {
* @throws IllegalArgumentException if the collection has * @throws IllegalArgumentException if the collection has
* <code>null</code> elements or is <code>null</code> * <code>null</code> elements or is <code>null</code>
*/ */
public static void noNullElements(Collection collection, String message) { public static void noNullElements(Collection<?> collection, String message) {
Validate.notNull(collection); Validate.notNull(collection);
for (Iterator<?> it = collection.iterator(); it.hasNext();) { for (Iterator<?> it = collection.iterator(); it.hasNext();) {
if (it.next() == null) { if (it.next() == null) {
@ -513,7 +513,7 @@ public class Validate {
* @throws IllegalArgumentException if the collection has * @throws IllegalArgumentException if the collection has
* <code>null</code> elements or is <code>null</code> * <code>null</code> elements or is <code>null</code>
*/ */
public static void noNullElements(Collection collection) { public static void noNullElements(Collection<?> collection) {
Validate.notNull(collection); Validate.notNull(collection);
int i = 0; int i = 0;
for (Iterator<?> it = collection.iterator(); it.hasNext(); i++) { for (Iterator<?> it = collection.iterator(); it.hasNext(); i++) {
@ -537,7 +537,7 @@ public class Validate {
* @param message the exception message if the <code>Collection</code> has elements not of type <code>clazz</code> * @param message the exception message if the <code>Collection</code> has elements not of type <code>clazz</code>
* @since 2.1 * @since 2.1
*/ */
public static void allElementsOfType(Collection collection, Class clazz, String message) { public static void allElementsOfType(Collection<?> collection, Class<?> clazz, String message) {
Validate.notNull(collection); Validate.notNull(collection);
Validate.notNull(clazz); Validate.notNull(clazz);
for (Iterator<?> it = collection.iterator(); it.hasNext(); ) { for (Iterator<?> it = collection.iterator(); it.hasNext(); ) {
@ -567,7 +567,7 @@ public class Validate {
* the <code>Class</code> which the collection's elements are expected to be, not null * the <code>Class</code> which the collection's elements are expected to be, not null
* @since 2.1 * @since 2.1
*/ */
public static void allElementsOfType(Collection collection, Class clazz) { public static void allElementsOfType(Collection<?> collection, Class<?> clazz) {
Validate.notNull(collection); Validate.notNull(collection);
Validate.notNull(clazz); Validate.notNull(clazz);
int i = 0; int i = 0;