This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: is it a bug of libgcj ?
- From: Hannes Wallnoefer <hannesw at gmail dot com>
- To: bbskill <bbkills at tom dot com>
- Cc: java at gcc dot gnu dot org
- Date: Fri, 5 Aug 2005 10:24:52 +0200
- Subject: Re: is it a bug of libgcj ?
- References: <42F30511.4090104@tom.com>
- Reply-to: hannes at apache dot org
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