This is an automated email from the ASF dual-hosted git repository.
jiangmaolin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new c9aa1462e8b Remove redundant null check of directoryUrlEnumeration in
ClasspathResourceDirectoryReader (#33641)
c9aa1462e8b is described below
commit c9aa1462e8b565b4705cb93731fc28bbd30f711b
Author: Raigor <[email protected]>
AuthorDate: Wed Nov 13 20:14:36 2024 +0800
Remove redundant null check of directoryUrlEnumeration in
ClasspathResourceDirectoryReader (#33641)
---
.../infra/util/directory/ClasspathResourceDirectoryReader.java | 3 ---
1 file changed, 3 deletions(-)
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/directory/ClasspathResourceDirectoryReader.java
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/directory/ClasspathResourceDirectoryReader.java
index 4bc15177972..993bd78ee83 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/directory/ClasspathResourceDirectoryReader.java
+++
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/directory/ClasspathResourceDirectoryReader.java
@@ -116,9 +116,6 @@ public final class ClasspathResourceDirectoryReader {
@SneakyThrows(IOException.class)
public static Stream<String> read(final ClassLoader classLoader, final
String directory) {
Enumeration<URL> directoryUrlEnumeration =
classLoader.getResources(directory);
- if (null == directoryUrlEnumeration) {
- return Stream.empty();
- }
return
Collections.list(directoryUrlEnumeration).stream().flatMap(directoryUrl -> {
if (JAR_URL_PROTOCOLS.contains(directoryUrl.getProtocol())) {
return readDirectoryInJar(directory, directoryUrl);