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 2021/02/15 07:25:08 UTC

[GitHub] [cxf] coheigea commented on a change in pull request #745: CXF-8422: Unclosed input streams after using org.apache.cxf.tools.wsdlto.WSDLToJava

coheigea commented on a change in pull request #745:
URL: https://github.com/apache/cxf/pull/745#discussion_r575983865



##########
File path: tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
##########
@@ -1305,9 +1305,10 @@ private static String mapSchemaLocation(String target, String base, OASISCatalog
 
 
         try {
-            URIResolver resolver = new URIResolver(base, target);
-            if (resolver.isResolved()) {
-                target = resolver.getURI().toString();
+            try (URIResolver resolver = new URIResolver(base, target)) {

Review comment:
       Do we really need to have a nested try statement here?

##########
File path: core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
##########
@@ -100,10 +100,10 @@ public String getResolvedEntity(String publicId, String systemId) {
                     String s = super.getResolvedEntity(publicId, systemId);
                     if (s != null && s.startsWith("classpath:")) {
                         try {
-                            URIResolver r = new URIResolver(s);
-                            if (r.isResolved()) {
-                                r.getInputStream().close();
-                                return r.getURL().toExternalForm();
+                            try (URIResolver r = new URIResolver(s)) {

Review comment:
       Do we really need to have a nested try statement here?




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