1717
1818package jakarta .servlet ;
1919
20+ import jakarta .annotation .Nullable ;
21+
2022/**
2123 * Event that gets fired when the asynchronous operation initiated on a ServletRequest (via a call to
2224 * {@link ServletRequest#startAsync} or {@link ServletRequest#startAsync(ServletRequest, ServletResponse)}) has
@@ -29,6 +31,7 @@ public class AsyncEvent {
2931 private final AsyncContext context ;
3032 private final ServletRequest request ;
3133 private final ServletResponse response ;
34+ @ Nullable
3235 private final Throwable throwable ;
3336
3437 /**
@@ -69,7 +72,7 @@ public AsyncEvent(AsyncContext context, Throwable throwable) {
6972 * @param response the ServletResponse to be delivered with this AsyncEvent
7073 * @param throwable the Throwable to be delivered with this AsyncEvent
7174 */
72- public AsyncEvent (AsyncContext context , ServletRequest request , ServletResponse response , Throwable throwable ) {
75+ public AsyncEvent (AsyncContext context , ServletRequest request , ServletResponse response , @ Nullable Throwable throwable ) {
7376 this .context = context ;
7477 this .request = request ;
7578 this .response = response ;
@@ -97,6 +100,7 @@ public AsyncContext getAsyncContext() {
97100 * @return the ServletRequest that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized
98101 * without any ServletRequest
99102 */
103+ @ Nullable
100104 public ServletRequest getSuppliedRequest () {
101105 return request ;
102106 }
@@ -113,6 +117,7 @@ public ServletRequest getSuppliedRequest() {
113117 * @return the ServletResponse that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized
114118 * without any ServletResponse
115119 */
120+ @ Nullable
116121 public ServletResponse getSuppliedResponse () {
117122 return response ;
118123 }
@@ -123,6 +128,7 @@ public ServletResponse getSuppliedResponse() {
123128 * @return the Throwable that was used to initialize this AsyncEvent, or null if this AsyncEvent was initialized without
124129 * any Throwable
125130 */
131+ @ Nullable
126132 public Throwable getThrowable () {
127133 return throwable ;
128134 }
0 commit comments