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

mattnewsome@fuckmicrosoft.com mattnewsome@fuckmicrosoft.com
Mon Sep 24 08:56:00 GMT 2001


>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:



More information about the Java-prs mailing list