Details
Description
According to https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/container/AsyncResponse.html#register(java.lang.Class):
we need throw NullPointerException - in case the callback class is null in all register method.
However, CXF swallows the NPE.
The proposed fix is to throw NPE in below method:
public Map<Class<?>, Collection<Class<?>>> register(Class<?> callback, Class<?>... callbacks)
throws NullPointerException {
try {
Object[] extraCallbacks = new Object[callbacks.length];
for (int i = 0; i < callbacks.length; i++)
return register(callback.newInstance(), extraCallbacks);
}
//proposed change start
catch (NullPointerException e)
//proposed change end
catch (Throwable t)
}
After this, my CTS passed!