This is the mail archive of the java-prs@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]

libgcj/4383: file: protocol not supported in URLConnection?



>Number:         4383
>Category:       libgcj
>Synopsis:       file: protocol not supported in URLConnection?
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 24 08:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Matt Newsome
>Release:        gcj (gcc 3.0.1)
>Organization:
>Environment:
linux x86
>Description:
Using a file: URL with URL.openConnection() to create a URLConnection() throws a NullPointerException.  Similarly for any server name in an http: URL where that server name cannot be resolved to via DNS.



Took me a while to realise why my code was producing an unexplained NullPointerException.



Not supporting file: is ok (though would be very useful) however the NPE is confusing and should be changed to something more meaningful if possible.
>How-To-Repeat:
More details if required - email me.
>Fix:
Use FileInputStream instead of URLConnection for file: URLs.
>Release-Note:
>Audit-Trail:
>Unformatted:


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