classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] ClassLoader.getExtClassLoaderUrls() nullpointer fix


From: Mark Wielaard
Subject: Re: [cp-patches] ClassLoader.getExtClassLoaderUrls() nullpointer fix
Date: Sun, 16 Jan 2005 16:25:51 +0100

Hi,

Thanks for the patch.
We discussed it a little on irc already.
It is indeed needed when one of the java.ext.path components is a file
since then File.getFiles() returns null (and not an empty array).

Cleaned up for our coding conventions and committed as follows:

2005-01-16  Mark Wielaard  <address@hidden>

        Reported by Christian Thalinger <address@hidden>
        * java/lang/ClassLoader.java (getExtClassLoaderUrls): Add check for
        null returned from getFiles().

Thanks,

Mark

--- java/lang/ClassLoader.java  7 Jan 2005 15:08:23 -0000       1.44
+++ java/lang/ClassLoader.java  16 Jan 2005 15:19:47 -0000
@@ -997,10 +997,9 @@
          {
            File f = new File(tok.nextToken());
            File[] files = f.listFiles();
-           for (int i = 0; i < files.length; i++)
-             {
+           if (files != null)
+             for (int i = 0; i < files.length; i++)
                list.add(files[i].toURL());
-             }
          }
        catch(Exception x)
          {

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]