Nullability refinements and related polishing

This commit is contained in:
Juergen Hoeller
2019-07-31 13:45:48 +02:00
parent cca32a56a4
commit e6f86c5c75
12 changed files with 147 additions and 149 deletions

View File

@@ -900,7 +900,7 @@ public abstract class StringUtils {
* @return the resulting {@code String} array
*/
public static String[] toStringArray(@Nullable Collection<String> collection) {
return (collection != null || collection.isEmpty() ? collection.toArray(EMPTY_STRING_ARRAY) : EMPTY_STRING_ARRAY);
return (!CollectionUtils.isEmpty(collection) ? collection.toArray(EMPTY_STRING_ARRAY) : EMPTY_STRING_ARRAY);
}
/**