@@ -340,11 +340,12 @@ public void println(double d) throws IOException {
340
340
* If an attempt is made to write to the stream when the stream is in async mode and this method has not returned
341
341
* {@code true} the method will throw an {@link IllegalStateException}.
342
342
* <p>
343
- * If an error occurs and {@link WriteListener#onError(Throwable)} is invoked then this method will always return false,
344
- * as no further IO operations are allowed after {@code onError} notification.
345
- * <p>
346
- * Note that due to the requirement for {@code write} to never throw in async mode, this method must return false if a
347
- * call to {@code write} would result in an exception.
343
+ * If an error occurs then either: this method will return {@code true} and
344
+ * an {@link IOException} will be thrown from a subsequent call to {@code write(...)};
345
+ * or this method will return {@code false} and subsequently {@link WriteListener#onError(Throwable)}
346
+ * will be invoked with the error. Once the error has either been thrown or passed to
347
+ * {@link WriteListener#onError(Throwable)}, then this method will always return {@code true} and all
348
+ * further {@code write} operations will throw an {@link IOException}.
348
349
*
349
350
* @return {@code true} if data can be written without blocking, otherwise returns {@code false}.
350
351
* @see WriteListener
@@ -356,15 +357,17 @@ public void println(double d) throws IOException {
356
357
* Instructs the <code>ServletOutputStream</code> to invoke the provided {@link WriteListener} when it is possible to
357
358
* write.
358
359
* <p>
359
- * Note that after this method has been called methods on this stream that are documented to throw {@link IOException}
360
- * will no longer throw these exceptions directly, instead any exception that occurs will be reported via
361
- * {@link WriteListener #onError(Throwable)}. Please refer to this method for more information. This only applies to
362
- * {@code IOException}, other exception types may still be thrown (e.g. methods can throw {@link IllegalStateException}
363
- * if {@link #isReady()} has not returned true).
360
+ * Note that after this method has been called, methods on this stream that are documented
361
+ * to throw {@link IOException} might not throw these exceptions directly,
362
+ * instead they may be reported via {@link ReadListener #onError(Throwable)} after a call to
363
+ * {@link #isReady()} has returned {@code false}.
364
+ * Please refer to {@link #isReady()} method for more information.
364
365
* <p>
365
- * Once this method has been called {@link #flush()} and {@link #close()} become asynchronous operations, they will be
366
- * performed in the background and any problems will be reported through the {@link WriteListener#onError(Throwable)}
367
- * method.
366
+ * Once this method has been called {@link #flush()} and {@link #close()} become asynchronous
367
+ * operations, possibly performed in the background. Thus any problems may be reported through the
368
+ * {@link WriteListener#onError(Throwable)} method, which may be called at any time
369
+ * after a {@link #close()} or otherwise only after a call to {@link #isReady()} has returned
370
+ * {@code false}.
368
371
*
369
372
* @param writeListener the {@link WriteListener} that should be notified when it's possible to write
370
373
*
0 commit comments