chore: 优化 Nullability Annotations 使用

This commit is contained in:
2026-05-21 22:17:32 +08:00
parent 84112fcf45
commit f2b9beb873
2 changed files with 2 additions and 2 deletions

View File

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

View File

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