This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: java.sql fix


I'm checking this in on the trunk.  I'm also checking it in to
Classpath.

2001-05-31  Tom Tromey  <tromey@redhat.com>

	* java/sql/DriverManager.java (getDrivers): Handle case where
	driver's class loader is null.  From Corey Minyard.

Tom

Index: java/sql/DriverManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/sql/DriverManager.java,v
retrieving revision 1.3
diff -u -r1.3 DriverManager.java
--- java/sql/DriverManager.java	2000/12/28 22:21:36	1.3
+++ java/sql/DriverManager.java	2001/05/31 16:16:33
@@ -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 @@
   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);
     } 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]