Affects Version/s: None
Fix Version/s: 2.1
WAE and subclasses have constructors accepting Response and cause Throwable.
The spec text makes it impossible for the application code to throw WAE initialized with Response containing entity and the cause exception and make this cause exception visible to custom mappers expecting to react somehow to the cause exceptions.
1. Keep the current optimization in place but update the spec to say that "if WAE Response entity is null or WAE cause exception is not null - use the mapper, otherwise - use WAE Response entity directly"
IMHO, much better solution is to drop this optimization - the typical mapper will never blindly replace WAE initialized Response - so keeping this optimization in place would really be about protecting the expectations of the providers which have not been written well.
If that still not an option - then 1 has to be done IMHO, the mappers must be able to see WAE cause exceptions if it is what the user wished by using the relevant constructors from the code