-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
9
-
generic
-
generic
FULL PRODUCT VERSION :
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+142)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+142, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Using the request()-method on HttpClient without specifying a URI will always throw NPE, as the implementation
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a HttpRequest.Builder using the no-param request-method on HttpClient
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
HttpRequest.Builder is created
ACTUAL -
NullPointerException is thrown from HttpRequestBuilderImpl.checkURI
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.NullPointerException
at java.net.http.HttpRequestBuilderImpl.checkURI(java.httpclient@9-ea/HttpRequestBuilderImpl.java:70)
at java.net.http.HttpRequestBuilderImpl.<init>(java.httpclient@9-ea/HttpRequestBuilderImpl.java:48)
at java.net.http.HttpClientImpl.request(java.httpclient@9-ea/HttpClientImpl.java:420)
at java.net.http.HttpClientImpl.request(java.httpclient@9-ea/HttpClientImpl.java:61)
at java9.HttpClientMain.main(HttpClientMain.java:22)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
HttpClient.getDefault()
.request()
.uri(URI.create("http://www.example.com"))
.GET();
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
HttpClient.getDefault()
.request(URI.create("http://www.example.com"))
.GET();
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+142)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+142, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Using the request()-method on HttpClient without specifying a URI will always throw NPE, as the implementation
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a HttpRequest.Builder using the no-param request-method on HttpClient
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
HttpRequest.Builder is created
ACTUAL -
NullPointerException is thrown from HttpRequestBuilderImpl.checkURI
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.NullPointerException
at java.net.http.HttpRequestBuilderImpl.checkURI(java.httpclient@9-ea/HttpRequestBuilderImpl.java:70)
at java.net.http.HttpRequestBuilderImpl.<init>(java.httpclient@9-ea/HttpRequestBuilderImpl.java:48)
at java.net.http.HttpClientImpl.request(java.httpclient@9-ea/HttpClientImpl.java:420)
at java.net.http.HttpClientImpl.request(java.httpclient@9-ea/HttpClientImpl.java:61)
at java9.HttpClientMain.main(HttpClientMain.java:22)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
HttpClient.getDefault()
.request()
.uri(URI.create("http://www.example.com"))
.GET();
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
HttpClient.getDefault()
.request(URI.create("http://www.example.com"))
.GET();
- relates to
-
JDK-8170093 HttpRequest.Builder does not validate method names passed to Builder.method()
- Resolved