diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/BanClassLoader.java b/core/src/main/java/com/google/errorprone/bugpatterns/BanClassLoader.java index f7528a7dd9f..de59bde14b6 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/BanClassLoader.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/BanClassLoader.java @@ -48,6 +48,8 @@ public final class BanClassLoader extends AbstractBanUnsafeAPIChecker private static final Matcher METHOD_MATCHER = anyOf( anyMethod().onDescendantOf("java.lang.ClassLoader").named("defineClass"), + anyMethod().onDescendantOf("jdk.internal.misc.Unsafe").named("defineClass"), + anyMethod().onDescendantOf("jdk.internal.access.JavaLangAccess").named("defineClass"), anyMethod().onDescendantOf("java.lang.invoke.MethodHandles.Lookup").named("defineClass"), anyMethod() .onDescendantOf("java.rmi.server.RMIClassLoader")