forked from plusone/plusone-commons
chore: 优化 Nullability Annotations 使用
This commit is contained in:
@@ -261,7 +261,7 @@ public class ArrayTools {
|
||||
*
|
||||
* @throws IllegalArgumentException 当参数为空时抛出
|
||||
*/
|
||||
public static <T> boolean isAllElementsNotNull(final T[] arr) {
|
||||
public static <T> boolean isAllElementsNotNull(@Nullable final T[] arr) {
|
||||
checkArgument(arr != null, "The array cannot be null.");
|
||||
return Arrays.stream(arr).allMatch(Objects::nonNull);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class RegexTools {
|
||||
.maximumSize(MAX_CACHE_SIZE)
|
||||
.build(new CacheLoader<RegexAndFlags, Pattern>() {
|
||||
@SuppressWarnings("null")
|
||||
public Pattern load(@Nonnull RegexAndFlags regexAndFlags) {
|
||||
public Pattern load(RegexAndFlags regexAndFlags) {
|
||||
return regexAndFlags.compilePattern();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user