This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 46001 - NullPointerException when trying to scan directory that can not be listed
Summary: NullPointerException when trying to scan directory that can not be listed
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-10 19:38 UTC by Jan Lahoda
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The NullPointerException. (1.34 KB, text/plain)
2004-07-10 19:39 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2004-07-10 19:38:24 UTC
(current sources of java module), JDK1.4.2_04.

During scanning of the classpath, the attached
NullPointerException can be thrown (and shown).
The problem is that if the scanning tries to list
files in a directory, and the user do not have
sufficient rights to list this directory,
File.listFiles may return null. The problems is
that the
org.netbeans.modules.javacore.scanning.FileEntry
is not able to handle null from listFiles.

I propose to fix this by adding a test for null.

This situation (insufficient rights for directory
list) can simply happen if a classpath is guessed
for some files in a Favourites tab, etc.

(I am making it P2 as it breaks some of my tests.)
Comment 1 Jan Lahoda 2004-07-10 19:39:35 UTC
Created attachment 16185 [details]
The NullPointerException.
Comment 2 Tomas Hurka 2004-07-12 10:58:23 UTC
Checking in org/netbeans/modules/javacore/scanning/FileEntry.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/scanning/FileEntry.java,v  
<--  FileEntry.java
new revision: 1.2; previous revision: 1.1
done
Comment 3 Jan Lahoda 2004-07-12 14:32:17 UTC
Revision 1.2 of FileEntry seems OK.
Comment 4 Quality Engineering 2007-09-20 11:56:30 UTC
Reorganization of java component