-
Bug
-
Resolution: Unresolved
-
P5
-
None
-
11, 25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The synchronous example in HttpClient javadoc (lines 96-107) references
an undefined 'request' variable, which causes a compilation error if
someone copies the example code directly.
File: src/java.net.http/share/classes/java/net/http/HttpClient.java
Lines: 96-107
The asynchronous example (lines 111-119) correctly shows the HttpRequest
creation, but the synchronous example is missing this step.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Open HttpClient javadoc
2. Copy the synchronous example code (lines 96-107)
3. Try to compile it
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The example should compile and run without errors.
The HttpRequest should be declared before being used in client.send().
ACTUAL -
Compilation error: 'request' variable is not defined
The synchronous example in HttpClient javadoc (lines 96-107) references
an undefined 'request' variable, which causes a compilation error if
someone copies the example code directly.
File: src/java.net.http/share/classes/java/net/http/HttpClient.java
Lines: 96-107
The asynchronous example (lines 111-119) correctly shows the HttpRequest
creation, but the synchronous example is missing this step.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Open HttpClient javadoc
2. Copy the synchronous example code (lines 96-107)
3. Try to compile it
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The example should compile and run without errors.
The HttpRequest should be declared before being used in client.send().
ACTUAL -
Compilation error: 'request' variable is not defined
- links to
-
Review(master)
openjdk/jdk/28084