Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.6.2.Final, 4.0.0.Beta6
-
None
Description
According to the javadoc of:
- Response.readEntity(Class)
- Response.readEntity(javax.ws.rs.core.GenericType)
- Response.readEntity(Class, Annotation [])
- Response.readEntity(javax.ws.rs.core.GenericType, Annotation [])
- those methods are supposed to close the original entity input stream (unless the supplied type is input stream) and then cache the result for subsequent retrievals via Response.getEntity().
So it clearly means that those methods MUST not close() the response itself, else subsequent retrievals via Response.getEntity() will always end up with IllegalStateException being thrown.
Instead, only the underlying input stream should be closed. - Subsequent call to one of those methods MUST throw an IllegalStateException if the original entity input stream has already been fully consumed without buffering the entity data prior consuming.