Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2112

ClientResponse.readEntity(XXX) does not completely follow the spec

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 3.6.2.Final, 4.0.0.Beta6
    • jaxrs
    • 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 [])
      1. 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.
      2. 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nicones Nicolas NESMON
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: