Skip to content

Commit

Permalink
Adding mapper could fail under JPMS
Browse files Browse the repository at this point in the history
Under JPMS, ClassLoader#getResources() throws `FileSystemException` it seems.
It might be better to catch IOException, but it could swallow some exception that should be thrown.

Should fix #2598
  • Loading branch information
harawata committed Nov 11, 2022
1 parent afc439a commit ced7973
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/apache/ibatis/io/DefaultVFS.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystemException;
import java.nio.file.InvalidPathException;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -107,8 +108,8 @@ public List<String> list(URL url, String path) throws IOException {
break;
}
}
} catch (InvalidPathException e) {
// #1974
} catch (InvalidPathException | FileSystemException e) {
// #1974 #2598
lines.clear();
}
if (!lines.isEmpty()) {
Expand Down

0 comments on commit ced7973

Please sign in to comment.