Skip to content

Commit b93579a

Browse files
committed
Polish
1 parent e8d2c6c commit b93579a

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

spring-web/src/main/java/org/springframework/http/server/reactive/AbstractListenerWriteProcessor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ protected void writingComplete() {
163163
}
164164

165165
/**
166-
* Invoked when an error happens while writing. Defaults to no-op.
167-
* Servlet 3.1 based implementations will receive
168-
* {@link WriteListener#onError(Throwable)} event.
166+
* Invoked when an error happens while writing.
167+
* <p>Defaults to no-op. Servlet 3.1 based implementations will receive
168+
* {@code javax.servlet.WriteListener#onError(Throwable)} event.
169169
*/
170-
protected void writingFailed(Throwable t) {
170+
protected void writingFailed(Throwable ex) {
171171
}
172172

173173

spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpResponse.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ public void onError(AsyncEvent event) {
192192
}
193193

194194
void handleError(Throwable ex) {
195-
if (bodyFlushProcessor != null) {
196-
bodyFlushProcessor.cancel();
197-
bodyFlushProcessor.onError(ex);
195+
ResponseBodyFlushProcessor flushProcessor = bodyFlushProcessor;
196+
if (flushProcessor != null) {
197+
flushProcessor.cancel();
198+
flushProcessor.onError(ex);
198199
}
199200

200201
ResponseBodyProcessor processor = bodyProcessor;
@@ -206,9 +207,10 @@ void handleError(Throwable ex) {
206207

207208
@Override
208209
public void onComplete(AsyncEvent event) {
209-
if (bodyFlushProcessor != null) {
210-
bodyFlushProcessor.cancel();
211-
bodyFlushProcessor.onComplete();
210+
ResponseBodyFlushProcessor flushProcessor = bodyFlushProcessor;
211+
if (flushProcessor != null) {
212+
flushProcessor.cancel();
213+
flushProcessor.onComplete();
212214
}
213215

214216
ResponseBodyProcessor processor = bodyProcessor;

spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ protected void writingComplete() {
231231
}
232232

233233
@Override
234-
protected void writingFailed(Throwable t) {
234+
protected void writingFailed(Throwable ex) {
235235
cancel();
236-
onError(t);
236+
onError(ex);
237237
}
238238
}
239239

0 commit comments

Comments
 (0)