Perform NullAway build-time checks in spring-web

Also in spring-websocket.

See gh-32475
This commit is contained in:
Sébastien Deleuze
2024-03-25 11:10:30 +01:00
parent 2b1eb488fc
commit e52ee01ec8
17 changed files with 27 additions and 3 deletions

View File

@@ -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());
}

View File

@@ -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());
}