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



##########
File path: 
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
##########
@@ -400,12 +472,30 @@ private Link makeAbsoluteLink(Link link) {
                 responseMessage.put(Message.PROTOCOL_HEADERS, getHeaders());
 
                 lastEntity = JAXRSUtils.readFromMessageBodyReader(readers, 
cls, t,
-                                                                       anns,
-                                                                       
entityStream,
-                                                                       
mediaType,
-                                                                       
responseMessage);
-                autoClose(cls, false);
-                return castLastEntity();
+                                                                  anns,
+                                                                  entityStream,
+                                                                  mediaType,
+                                                                  
responseMessage);
+                // close the entity after readEntity is called.
+                T tCastLastEntity = castLastEntity();
+                shouldClose = shouldClose && !(tCastLastEntity instanceof 
Closeable)

Review comment:
       Shouldn't `AutoCloseable` also be checked?




----------------------------------------------------------------
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.

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


Reply via email to