Support lenient ContainerConnectionDetailsFactory hint registration
Update `ContainerConnectionDetailsFactory` hint registration logic so that types are optional on the classpath. See gh-36606 Fixes gh-38392
This commit is contained in:
@@ -20,6 +20,7 @@ import java.io.File;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.reflect.AnnotatedElement;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
@@ -297,7 +298,10 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
|
||||
private boolean isExcluded(URL url) {
|
||||
if ("file".equals(url.getProtocol())) {
|
||||
try {
|
||||
String name = new File(url.toURI()).getName();
|
||||
URI uri = url.toURI();
|
||||
File file = new File(uri);
|
||||
String name = (!uri.toString().endsWith("/")) ? file.getName()
|
||||
: file.getParentFile().getParentFile().getName();
|
||||
for (String exclusion : this.exclusions) {
|
||||
if (this.matcher.match(exclusion, name)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user