JDK-6306744 : headline/4447135 failed in Mustang PIT b47
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,linux_redhat_3.0
  • CPU: generic,x86
  • Submitted: 2005-08-05
  • Updated: 2010-04-02
  • Resolved: 2005-09-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
Description
System Config.:
Mustang PIT b47

Symptom:
headline/4447135 failed in Mustang PIT b47.

The test feeds a MalformedURL to HttpURLConnection. The latest 
promoted build throws MalformedURLException, but the PIT build throws IllegalArgumentException. In this case, a 
MalformedURLException is more appropriate.

*URL*:
http://tatooine.sfbay.sun.com/index.html 
HTTP/1.1\nProxy-Connection: keep-alive\nHost: 
tatooine.sfbay.sun.com\n\nGET 
http://sqeweb.sfbay.sun.com/sec/public_html/test.html
--------------------------------------------------------------------

java.lang.IllegalArgumentException: URI can't be null.
	at sun.net.spi.DefaultProxySelector.select(DefaultProxySelector.java:111)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:720)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:650)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:947)
	at ProxyBack.fetch(ProxyBack.java:100)
	at ProxyBack.setRequestLine(ProxyBack.java:77)
	at ProxyBack.main(ProxyBack.java:166)
java.lang.IllegalArgumentException: URI can't be null.
	at sun.net.spi.DefaultProxySelector.select(DefaultProxySelector.java:111)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:720)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:650)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:947)
	at ProxyBack.fetch(ProxyBack.java:100)
	at ProxyBack.setRequestLine(ProxyBack.java:77)
	at ProxyBack.main(ProxyBack.java:173)

How to reproduce
1. download attached files
2. compile the java code
3. run:  java -Dhttp.proxyHost=scaweb1.sfbay.sun.com -Dhttp.proxyPort=8080 -Dhttp.keepAlive=true ProxyBack

Comments
EVALUATION In the fix for 6274990, code snippet String protocol = url.getProtocol(); String auth = url.getAuthority(); String path = url.getPath(); String query = url.getQuery(); String ref = url.getRef(); if (path != null && !(path.startsWith("/"))) path = "/" + path; java.net.URI uri; try { // if don't do this, URI may double escape path component path = decode(path); uri = new java.net.URI(protocol, auth, path, query, ref); } catch (java.net.URISyntaxException e) { uri = null; } return uri; is replaced by java.net.URI uri; try { uri = url.toURI(); } catch (java.net.URISyntaxException e) { uri = null; } return uri; They're semanticly equal, except: * The former will construct an URI with '/' path from an URL with empty path, while the later does not; * They behave differently if being feed with a MalformedURL. The former may return a MalformedURI, the later will return a null URI. Will fix soon.
08-08-2005