Skip to content

Commit

Permalink
Consistent use of Class<?> in Assert
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed May 16, 2013
1 parent a19c976 commit 16548d2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spring-core/src/main/java/org/springframework/util/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static void hasText(String text) {
*/
public static void doesNotContain(String textToSearch, String substring, String message) {
if (StringUtils.hasLength(textToSearch) && StringUtils.hasLength(substring) &&
textToSearch.indexOf(substring) != -1) {
textToSearch.contains(substring)) {
throw new IllegalArgumentException(message);
}
}
Expand Down Expand Up @@ -236,8 +236,8 @@ public static void notEmpty(Object[] array) {
*/
public static void noNullElements(Object[] array, String message) {
if (array != null) {
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
for (Object element : array) {
if (element == null) {
throw new IllegalArgumentException(message);
}
}
Expand Down Expand Up @@ -315,7 +315,7 @@ public static void notEmpty(Map map) {
* @throws IllegalArgumentException if the object is not an instance of clazz
* @see Class#isInstance
*/
public static void isInstanceOf(Class clazz, Object obj) {
public static void isInstanceOf(Class<?> clazz, Object obj) {
isInstanceOf(clazz, obj, "");
}

Expand All @@ -331,7 +331,7 @@ public static void isInstanceOf(Class clazz, Object obj) {
* @throws IllegalArgumentException if the object is not an instance of clazz
* @see Class#isInstance
*/
public static void isInstanceOf(Class type, Object obj, String message) {
public static void isInstanceOf(Class<?> type, Object obj, String message) {
notNull(type, "Type to check against must not be null");
if (!type.isInstance(obj)) {
throw new IllegalArgumentException(
Expand All @@ -348,7 +348,7 @@ public static void isInstanceOf(Class type, Object obj, String message) {
* @param subType the sub type to check
* @throws IllegalArgumentException if the classes are not assignable
*/
public static void isAssignable(Class superType, Class subType) {
public static void isAssignable(Class<?> superType, Class<?> subType) {
isAssignable(superType, subType, "");
}

Expand All @@ -363,7 +363,7 @@ public static void isAssignable(Class superType, Class subType) {
* ok when prepended to it.
* @throws IllegalArgumentException if the classes are not assignable
*/
public static void isAssignable(Class superType, Class subType, String message) {
public static void isAssignable(Class<?> superType, Class<?> subType, String message) {
notNull(superType, "Type to check against must not be null");
if (subType == null || !superType.isAssignableFrom(subType)) {
throw new IllegalArgumentException(message + subType + " is not assignable to " + superType);
Expand Down

0 comments on commit 16548d2

Please sign in to comment.