This is the mail archive of the java@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]
Other format: [Raw text]

Re: is it a bug of libgcj ?


2005/8/5, bbskill <bbkills@tom.com>:
> Why two examples behavior so different ? why the first example throws a
> java.lang.NullPointerException?
> is a bug of libgcj??

What seems to happen is that the File constructor is called with a
null file name argument because the native directory listing code gets
a directory entry with a null file name. libgcj should probably catch
this, but it looks to me like the deeper reason for the problem is
that there's something strange with your home directory.

You should be able to look at the listing in Java without throwing an
exception if you use File.list() rather than File.listFile() - loop
through the String array and watch for null elements. A full directory
listing in the shell may also reveal something.

The reason the second exampe works is bacause the exception isn't
thrown because of /home/bbskill/glftp, but some other directory entry
in your home directory.

hope that helps,
Hannes


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