You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2020/09/23 20:33:07 UTC

[GitHub] [cxf] andymc12 commented on a change in pull request #697: [CXF-8346] TCK Changes for URI and hasEntity checks

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



##########
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:
       `Closeable` extends `AutoCloseable`, so we could get both with by checking `AutoCloseable` - I'll update this.




----------------------------------------------------------------
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:
users@infra.apache.org