summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java/java/sql/DriverManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'luni/src/main/java/java/sql/DriverManager.java')
-rw-r--r--luni/src/main/java/java/sql/DriverManager.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/luni/src/main/java/java/sql/DriverManager.java b/luni/src/main/java/java/sql/DriverManager.java
index c3bef62..3dc0ed3 100644
--- a/luni/src/main/java/java/sql/DriverManager.java
+++ b/luni/src/main/java/java/sql/DriverManager.java
@@ -221,23 +221,17 @@ public class DriverManager {
* if there is any kind of problem accessing the database.
*/
public static Driver getDriver(String url) throws SQLException {
- // BEGIN android-changed
ClassLoader callerClassLoader = VMStack.getCallingClassLoader();
- // END android-changed
-
synchronized (theDrivers) {
/*
* Loop over the drivers in the DriverSet checking to see if one
* does understand the supplied URL - return the first driver which
* does understand the URL
*/
- Iterator<Driver> theIterator = theDrivers.iterator();
- while (theIterator.hasNext()) {
- Driver theDriver = theIterator.next();
- if (theDriver.acceptsURL(url)
- && DriverManager.isClassFromClassLoader(theDriver,
- callerClassLoader)) {
- return theDriver;
+ for (Driver driver : theDrivers) {
+ if (driver.acceptsURL(url) &&
+ DriverManager.isClassFromClassLoader(driver, callerClassLoader)) {
+ return driver;
}
}
}