Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8642

ResponseImpl#hasEntity changed behaviour starting with cxf 3.4.1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5.0, 3.4.1, 3.4.5
    • 3.4.6, 3.5.1, 4.0.0
    • JAX-RS
    • Unknown

    Description

      Starting with version cxf version 3.4.1 Response.hasEntitiy() does return false after a call to Response.readEntity() threw an exception, even when Response.bufferEntity() was called before.

      Response response = // obtain response with an entity from service call
      response.bufferEntity()
      response.hasEntity() // true
      response.readEntity(SomeWrongEntityClass.class) // throws an exception
      response.hasEntity() //false

      I created a github repository with ready-to-run sample code to show the issue https://github.com/cowclaw/cxf-regression

      Simply clone the repository and run ./gradlew build to see it in action.

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              cowclaw Florian Kamella
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: