提交 7195df95 编写于 作者: M mchung

8003851: MethodHandleNatives dependency on java.sql.DriverManager

Reviewed-by: alanb, dholmes
上级 6f8cbce1
......@@ -448,7 +448,7 @@ class MethodHandleNatives {
case "getDriver":
case "getDrivers":
case "deregisterDriver":
return defc == java.sql.DriverManager.class;
return defc == getClass("java.sql.DriverManager");
case "newUpdater":
if (defc == java.util.concurrent.atomic.AtomicIntegerFieldUpdater.class) return true;
if (defc == java.util.concurrent.atomic.AtomicLongFieldUpdater.class) return true;
......@@ -482,4 +482,14 @@ class MethodHandleNatives {
}
return false;
}
// avoid static dependency to a class in other modules
private static Class<?> getClass(String cn) {
try {
return Class.forName(cn, false,
MethodHandleNatives.class.getClassLoader());
} catch (ClassNotFoundException e) {
throw new InternalError(e);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册