Steven,
That's because try-with-resources and AutoClosable are SE 7 and JAX-RS 2.0 runs on SE 6. JAX-RS 2.1, upcoming in EE 8, will be able to take advantage of these new features.
-- Santiago
On Oct 1, 2014, at 6:18 PM, Steven Schlansker <stevenschlansker_at_gmail.com> wrote:
> Hi jax-rs users,
>
> I am curious why Response does not implement Closeable.
> That would allow all sorts of neat uses, in particular
> try-with-resources:
>
> try (Response resp = httpClient.target(…).get()) {
> // use resp
> } // resp closed!
>
> It may seem like a very small issue, but does impact
> usability in a non-trivial way.
>
> I didn’t see a clear answer on the mailing list.
> Hopefully someone can clarify.
>
> Thanks!
> Steven
>