Skip to content

Commit

Permalink
Fix regression on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke authored and Luke committed May 8, 2023
1 parent 51a2fc3 commit dbc40c8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public class ClasspathOrder {
/** Suffixes for automatic package roots, e.g. "!/BOOT-INF/classes". */
private static final List<String> AUTOMATIC_PACKAGE_ROOT_SUFFIXES = new ArrayList<>();

/** Match URL schemes. */
private static final Pattern schemeMatcher = Pattern.compile("^[a-zA-Z+\\-.]+:");
/** Match URL schemes (must consist of at least two chars, otherwise this is Windows drive letter). */
private static final Pattern schemeMatcher = Pattern.compile("^[a-zA-Z][a-zA-Z+\\-.]+:");

static {
for (final String prefix : ClassLoaderHandlerRegistry.AUTOMATIC_PACKAGE_ROOT_PREFIXES) {
Expand Down Expand Up @@ -338,6 +338,7 @@ public boolean addClasspathEntry(final Object pathElement, final ClassLoader cla
// Fall through
}
if (pathElementURL == null) {
// Escape percentage characters in URLs (#255)
final String urlStr = pathElementStr.replace("%", "%25");
try {
pathElementURL = new URL(urlStr);
Expand Down

0 comments on commit dbc40c8

Please sign in to comment.