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 49977 - NPE while opening file on Windows using unc pathname
Summary: NPE while opening file on Windows using unc pathname
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Open File (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Marian Petras
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2004-10-06 04:00 UTC by moizd
Modified: 2004-10-12 14:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
netbeans log file (131.48 KB, text/plain)
2004-10-06 04:01 UTC, moizd
Details
the exception (excerpt from the log) (2.34 KB, text/plain)
2004-10-06 14:24 UTC, Marian Petras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description moizd 2004-10-06 04:00:00 UTC
I tried to open a file using the following path

\\192.168.1.102\c$\projects\myproject\main\dev\java\com\mypackage\package1\package2\package2\Source.java

and i got the a NullPointerException.
Here is what i did. File->"Open File". Then I
entered
\\192.168.1.102\c$\projects\myproject\main\dev\java\com\mypackage\package1\package2\package2
as the file name and clicked Open. That's when i
got the NPE.
Comment 1 moizd 2004-10-06 04:01:44 UTC
Created attachment 18066 [details]
netbeans log file
Comment 2 Marian Petras 2004-10-06 14:24:09 UTC
Created attachment 18087 [details]
the exception (excerpt from the log)
Comment 3 Marian Petras 2004-10-07 10:55:43 UTC
The exception should not be thrown, I agree.

I changed a code in the OpenFile pseudo-module but I am not yet able
to test whether it helps or not. (I need more time for the check
because I need to setup computers for such a task.)

I would appreciate if you tried the daily build and reported how did
the change affect NetBeans' behaviour.

Modified file:

   utilities/:
      src/org/netbeans/modules/openfile/DefaultOpenFileImpl.java (1.8)

   (I modified the file twice - at first made revision 1.7, then 1.8)
Comment 4 Marian Petras 2004-10-11 16:46:41 UTC
So I tried how it behaves now, after the first modification: The NPE
is no longer thrown but nothing else happens - neither the file is
open nor an error message is displayed.

I am currently working on a patch such that the user gets a message
that the selected file cannot be open because of UNC not being supported.
Comment 5 Marian Petras 2004-10-12 14:22:22 UTC
Fixed in the trunk.

When the user specifies a file by UNC path, a message dialog appears,
informing the user that UNC paths are not supported.

The Utilities module supports two ways of opening files - from the
command-line argument (netbeans -open <filename>) or by the Open File
action (available from the File menu). The dialog is open in both
cases. In case of the Open File action, the dialog is displayed in the
file chooser _before_ the file chooser is closed.

Modified files:

   utilities/src/org/netbeans/modules/openfile/
      Bundle.properties   (1.36)
      OpenFile.java   (1.59)
      FileChooser.java   (1.5)