Perform NullAway build-time checks in spring-web
Also in spring-websocket. See gh-32475
This commit is contained in:
@@ -62,6 +62,7 @@ public abstract class CollectionUtils {
|
||||
* @param collection the Collection to check
|
||||
* @return whether the given Collection is empty
|
||||
*/
|
||||
@Contract("null -> true")
|
||||
public static boolean isEmpty(@Nullable Collection<?> collection) {
|
||||
return (collection == null || collection.isEmpty());
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public abstract class ObjectUtils {
|
||||
* either an Object array or a primitive array.
|
||||
* @param obj the object to check
|
||||
*/
|
||||
@Contract("null -> false")
|
||||
public static boolean isArray(@Nullable Object obj) {
|
||||
return (obj != null && obj.getClass().isArray());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user