Strengthen package-like assertions

See gh-42682
This commit is contained in:
Yanming Zhou
2024-10-15 14:49:07 +08:00
committed by Phillip Webb
parent 98dd7b2758
commit 87cc2efb64
6 changed files with 7 additions and 7 deletions

View File

@@ -280,7 +280,7 @@ public class AutoConfigureAnnotationProcessor extends AbstractProcessor {
}
private boolean isSpringClass(String type) {
return type.startsWith("org.springframework");
return type.startsWith("org.springframework.");
}
}

View File

@@ -150,7 +150,7 @@ public class Handler extends URLStreamHandler {
if (file.startsWith(TOMCAT_WARFILE_PROTOCOL) || !file.contains("*/")) {
try {
URLConnection connection = new URL(file).openConnection();
if (connection.getClass().getName().startsWith("org.apache.catalina")) {
if (connection.getClass().getName().startsWith("org.apache.catalina.")) {
return true;
}
}

View File

@@ -88,8 +88,8 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
@Override
public Class<?> loadClass(String name) throws ClassNotFoundException {
if (name.startsWith("org.junit") || name.startsWith("org.hamcrest")
|| name.startsWith("io.netty.internal.tcnative")) {
if (name.startsWith("org.junit.") || name.startsWith("org.hamcrest.")
|| name.startsWith("io.netty.internal.tcnative.")) {
return Class.forName(name, false, this.junitLoader);
}
String packageName = ClassUtils.getPackageName(name);