You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Learn -> The Stream API -> Creating Streams, the "Creating a Stream on an HTTP Source" section, I found that the compiler complains about some exceptions not being handled:
In Learn -> The Stream API -> Creating Streams, the "Creating a Stream on an HTTP Source" section, I found that the compiler complains about some exceptions not being handled:
HttpResponse<Stream<String>> response = client.send(request, HttpResponse.BodyHandlers.ofLines());Here, the compiler wants to handle
IOExceptionandInterruptedException.Having put the above in the try block, the compiler complained about
responsenot being initialised.The compiler also complained about
linesnot being initialised below this.In both cases, I initialised them to null outside of the try blocks, which seemed OK.