Skip to content

Commit

Permalink
fix: fix StringIndexOutOfBoundsException on issue mybatis#635
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterChangRay authored and kazuki43zoo committed Jun 12, 2022
1 parent 49ddaa1 commit 746ad04
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -48,6 +50,7 @@ public boolean isValid() {
@Override
protected List<String> list(URL url, String path) throws IOException {
String urlString = url.toString();
urlString = URLDecoder.decode(urlString, Charset.defaultCharset().name());
String baseUrlString = urlString.endsWith("/") ? urlString : urlString.concat("/");
Resource[] resources = resourceResolver.getResources(baseUrlString + "**/*.class");
return Stream.of(resources).map(resource -> preserveSubpackageName(baseUrlString, resource, path))
Expand Down

0 comments on commit 746ad04

Please sign in to comment.