@@ -184,7 +184,7 @@ public static void hasText(String text) {
184
184
*/
185
185
public static void doesNotContain (String textToSearch , String substring , String message ) {
186
186
if (StringUtils .hasLength (textToSearch ) && StringUtils .hasLength (substring ) &&
187
- textToSearch .indexOf (substring ) != - 1 ) {
187
+ textToSearch .contains (substring )) {
188
188
throw new IllegalArgumentException (message );
189
189
}
190
190
}
@@ -236,8 +236,8 @@ public static void notEmpty(Object[] array) {
236
236
*/
237
237
public static void noNullElements (Object [] array , String message ) {
238
238
if (array != null ) {
239
- for (int i = 0 ; i < array . length ; i ++ ) {
240
- if (array [ i ] == null ) {
239
+ for (Object element : array ) {
240
+ if (element == null ) {
241
241
throw new IllegalArgumentException (message );
242
242
}
243
243
}
@@ -315,7 +315,7 @@ public static void notEmpty(Map map) {
315
315
* @throws IllegalArgumentException if the object is not an instance of clazz
316
316
* @see Class#isInstance
317
317
*/
318
- public static void isInstanceOf (Class clazz , Object obj ) {
318
+ public static void isInstanceOf (Class <?> clazz , Object obj ) {
319
319
isInstanceOf (clazz , obj , "" );
320
320
}
321
321
@@ -331,7 +331,7 @@ public static void isInstanceOf(Class clazz, Object obj) {
331
331
* @throws IllegalArgumentException if the object is not an instance of clazz
332
332
* @see Class#isInstance
333
333
*/
334
- public static void isInstanceOf (Class type , Object obj , String message ) {
334
+ public static void isInstanceOf (Class <?> type , Object obj , String message ) {
335
335
notNull (type , "Type to check against must not be null" );
336
336
if (!type .isInstance (obj )) {
337
337
throw new IllegalArgumentException (
@@ -348,7 +348,7 @@ public static void isInstanceOf(Class type, Object obj, String message) {
348
348
* @param subType the sub type to check
349
349
* @throws IllegalArgumentException if the classes are not assignable
350
350
*/
351
- public static void isAssignable (Class superType , Class subType ) {
351
+ public static void isAssignable (Class <?> superType , Class <?> subType ) {
352
352
isAssignable (superType , subType , "" );
353
353
}
354
354
@@ -363,7 +363,7 @@ public static void isAssignable(Class superType, Class subType) {
363
363
* ok when prepended to it.
364
364
* @throws IllegalArgumentException if the classes are not assignable
365
365
*/
366
- public static void isAssignable (Class superType , Class subType , String message ) {
366
+ public static void isAssignable (Class <?> superType , Class <?> subType , String message ) {
367
367
notNull (superType , "Type to check against must not be null" );
368
368
if (subType == null || !superType .isAssignableFrom (subType )) {
369
369
throw new IllegalArgumentException (message + subType + " is not assignable to " + superType );
0 commit comments