Skip to content

Commit 1b4b10e

Browse files
Fix sonar
1 parent 96c134f commit 1b4b10e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/io/github/computerdaddyguy/jfiletreeprettyprinter/PathMatchers.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import java.util.regex.Pattern;
1515
import java.util.stream.Stream;
1616
import org.jspecify.annotations.NullMarked;
17-
import org.jspecify.annotations.Nullable;
1817

1918
/**
2019
* Utility class providing factory and composition methods for {@link PathMatcher}s.
@@ -193,15 +192,13 @@ public static PathMatcher anyOf(Iterable<PathMatcher> matchers) {
193192
return combineMatchers(matchers, Mode.ANY);
194193
}
195194

196-
private static List<PathMatcher> buildSafeList(PathMatcher matcher, @Nullable PathMatcher... matchers) {
195+
private static List<PathMatcher> buildSafeList(PathMatcher matcher, PathMatcher... matchers) {
197196
Objects.requireNonNull(matcher, "matcher is null");
198-
var list = new ArrayList<PathMatcher>(1 + (matchers == null ? 0 : matchers.length));
197+
var list = new ArrayList<PathMatcher>(1 + matchers.length);
199198
list.add(matcher);
200-
if (matchers != null) {
201-
for (PathMatcher m : matchers) {
202-
Objects.requireNonNull(m, "some matcher is null");
203-
list.add(m);
204-
}
199+
for (PathMatcher m : matchers) {
200+
Objects.requireNonNull(m, "some matcher is null");
201+
list.add(m);
205202
}
206203
return List.copyOf(list);
207204
}

0 commit comments

Comments
 (0)