bmhm commented on a change in pull request #649: CXF-8235 Handle null
continuation in AsyncResponseImpl
URL: https://github.com/apache/cxf/pull/649#discussion_r390148872
##########
File path:
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java
##########
@@ -302,6 +302,11 @@ public synchronized void handleTimeout() {
private void initContinuation() {
ContinuationProvider provider =
(ContinuationProvider)inMessage.get(ContinuationProvider.class.getName());
+ if (provider == null) {
+ throw new IllegalArgumentException(
Review comment:
The filters are a kind of argument, aren't they? When defining a filter in
`web.xml` or via `@WebFilter`… So yes, both are probably fine.
Anyway, the important thing here is that users see an exception with a
somewhat meaningful message. Without this fix, if you use e.g. Apache Shiro
`shiro-servlet:1.4.0`, you can only see a `NullPointerException` with a CXF
stack trace, which is not helpful at all. See the stack trace here:
https://github.com/bmhm/shiro-openliberty-npe and the issue for Apache SHIRO
here: https://issues.apache.org/jira/projects/SHIRO/issues/SHIRO-735.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services