reta commented on a change in pull request #893:
URL: https://github.com/apache/cxf/pull/893#discussion_r787300871



##########
File path: 
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
##########
@@ -152,6 +152,9 @@ public boolean hasEntity() {
         Object actualEntity = getActualEntity();
         if (actualEntity == null) {
             return false;
+        } else if (entityBufferred) {

Review comment:
       When exception occurs while reading entity, it could happen that:
    -  getActualEntity() return `entity` (since `lastEntity` is `null`)
    - but the `entity` 's `InputStream` is fully consumed and is not empty
    - however, reading over fully consumed stream in this case is equivalent to 
reading over empty stream: nothing left to read
   
   As such, the `hasEntity` return `false`. Adding the short circuit logic to 
make sure that if entity was buffered successfully, the response is considered 
to have an entity.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to