[jax-rs-spec users] [jsr339-experts] Re: Response.close() and Response.hasEntity()

From: Marek Potociar <>
Date: Thu, 16 Aug 2012 16:30:11 +0200

I guess we should throw IllegalStateException in such case.


On Aug 16, 2012, at 2:31 PM, Sergey Beryozkin <> wrote:

> Consider Response containing a non InputStream entity.
> What is the expected Response.hasEntity() result after Response.close() has been called ?
> I suppose it should return 'true' - but I'm not 100% sure.
> Should close() simply set the entity, whatever type it has to 'null', after closing it (in case of the entity being of type InputStream) ?
> If yes, then of course hasEntity() will return 'false' consistently.
> Thanks, Sergey