From: Tom Tromey Date: Thu, 31 May 2001 16:18:55 +0000 (+0000) Subject: DriverManager.java (getDrivers): Handle case where driver's class loader is null. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5980a00aeb42a5567fdafb818e1aa27ea5a866b6;p=gcc.git DriverManager.java (getDrivers): Handle case where driver's class loader is null. * java/sql/DriverManager.java (getDrivers): Handle case where driver's class loader is null. From Corey Minyard. From-SVN: r42745 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 9113e23e8d5..9cb3eb711aa 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2001-05-31 Tom Tromey + + * java/sql/DriverManager.java (getDrivers): Handle case where + driver's class loader is null. From Corey Minyard. + 2001-05-29 Tom Tromey * include/jvm.h (_Jv_ThrowNoMemory): Mark as noreturn. diff --git a/libjava/java/sql/DriverManager.java b/libjava/java/sql/DriverManager.java index 641bfe479c4..696facaff9c 100644 --- a/libjava/java/sql/DriverManager.java +++ b/libjava/java/sql/DriverManager.java @@ -1,5 +1,5 @@ /* DriverManager.java -- Manage JDBC drivers - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -264,8 +264,13 @@ getDrivers() while(e.hasMoreElements()) { Object obj = e.nextElement(); - if (!obj.getClass().getClassLoader().equals(cl)) - continue; + + ClassLoader loader = obj.getClass().getClassLoader(); + + if (loader == null) + loader = ClassLoader.getSystemClassLoader(); + if (!loader.equals(cl)) + continue; v.addElement(obj); }