[jax-rs-spec users] [jsr339-experts] Re: New abstract methods in Response

From: Bill Burke <>
Date: Thu, 25 Oct 2012 09:08:36 -0400

On 10/25/2012 8:59 AM, Marek Potociar wrote:
> Hello experts,
> As you know we've added quite a lot of new abstract methods to the
> Response API. The approach is however somewhat problematic, because
> Response javadoc states that:
> /An application class can extend this class directly or can use one of
> the static methods to create an instance using a ResponseBuilder./
> So, adding new abstract methods is strictly speaking a BV incompatible
> change. Still, we are not aware of any application developer extending
> the Response class. Are you?

BV? I think your mind is elsewhere ;)

> We thought we would change the javadoc to not support extending Response
> anymore and at the same time implement the newly added methods. Yet, as
> it turns out, the only practical default implementation would be to
> throw an UnsupportedOpperationException in most cases. Otherwise we
> would have to bring in a lot of internal utility classes from Jersey
> into the API and the implementation would still only work on the server
> side. Therefore we feel that it would be best to keep the new methods
> abstract and only change the javadoc to state that:
> /An application class should not extend this class directly. Response
> class is reserved for an extension by a JAX-RS implementation providers.
> An application should use one of the static methods to create a Response
> instance using a ResponseBuilder./
> Again, this is a BW-incompatible change. But we don't know any
> application that would be really extending the Response class.

+1000. I *REALLY* hated this in 1.0.

> Let us know what you think about the proposal. Given the full context,
> would you support it even if it is BW-incompatible change?

To be honest, I'm don't know if Resteasy would barf or not if a user
tried to use their own implementation of Response. IMO, this is very
similar to the DataHandler thing a few weeks back.

Bill Burke
JBoss, a division of Red Hat