提交 c187b144 编写于 作者: L lancea

7034656: Address lint warnings for DriverManager

Reviewed-by: alanb, forax, ohair
上级 0c83e938
...@@ -483,8 +483,8 @@ public class DriverManager { ...@@ -483,8 +483,8 @@ public class DriverManager {
private static void loadInitialDrivers() { private static void loadInitialDrivers() {
String drivers; String drivers;
try { try {
drivers = (String) AccessController.doPrivileged(new PrivilegedAction() { drivers = AccessController.doPrivileged(new PrivilegedAction<String>() {
public Object run() { public String run() {
return System.getProperty("jdbc.drivers"); return System.getProperty("jdbc.drivers");
} }
}); });
...@@ -496,8 +496,8 @@ public class DriverManager { ...@@ -496,8 +496,8 @@ public class DriverManager {
// exposed as a java.sql.Driver.class service. // exposed as a java.sql.Driver.class service.
// ServiceLoader.load() replaces the sun.misc.Providers() // ServiceLoader.load() replaces the sun.misc.Providers()
AccessController.doPrivileged(new PrivilegedAction() { AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Object run() { public Void run() {
ServiceLoader<Driver> loadedDrivers = ServiceLoader.load(Driver.class); ServiceLoader<Driver> loadedDrivers = ServiceLoader.load(Driver.class);
Iterator driversIterator = loadedDrivers.iterator(); Iterator driversIterator = loadedDrivers.iterator();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册