提交 accccf1e 编写于 作者: L lancea

6988317: RowSetProvider.newFactory() may throw unspecified exception

Reviewed-by: darcy
上级 4a7f236b
...@@ -28,6 +28,7 @@ package javax.sql.rowset; ...@@ -28,6 +28,7 @@ package javax.sql.rowset;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader; import java.util.ServiceLoader;
/** /**
...@@ -255,14 +256,20 @@ public class RowSetProvider { ...@@ -255,14 +256,20 @@ public class RowSetProvider {
* Use the ServiceLoader mechanism to load the default RowSetFactory * Use the ServiceLoader mechanism to load the default RowSetFactory
* @return default RowSetFactory Implementation * @return default RowSetFactory Implementation
*/ */
static private RowSetFactory loadViaServiceLoader() { static private RowSetFactory loadViaServiceLoader() throws SQLException {
RowSetFactory theFactory = null; RowSetFactory theFactory = null;
trace("***in loadViaServiceLoader()"); try {
trace("***in loadViaServiceLoader():");
for (RowSetFactory factory : ServiceLoader.load(javax.sql.rowset.RowSetFactory.class)) { for (RowSetFactory factory : ServiceLoader.load(javax.sql.rowset.RowSetFactory.class)) {
trace(" Loading done by the java.util.ServiceLoader :" + factory.getClass().getName()); trace(" Loading done by the java.util.ServiceLoader :" + factory.getClass().getName());
theFactory = factory; theFactory = factory;
break; break;
} }
} catch (ServiceConfigurationError e) {
throw new SQLException(
"RowSetFactory: Error locating RowSetFactory using Service "
+ "Loader API: " + e, e);
}
return theFactory; return theFactory;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册