This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit c17b8f61ec863a253762bc14ad48f4415fa7dd8c
Author: Dennis Kieselhorst <[email protected]>
AuthorDate: Mon Dec 25 12:50:52 2017 +0100

    [CXF-7595] ensure InputStream gets closed after loading swagger.properties
    
    (cherry picked from commit d00d731682ef5707000a5186203ecf6b1cc1731c)
---
 .../main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
 
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
index 9161997..7ea8d4c 100644
--- 
a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
+++ 
b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/Swagger2Feature.java
@@ -246,8 +246,15 @@ public class Swagger2Feature extends 
AbstractSwaggerFeature {
                 props.load(is);
             } catch (IOException ex) {
                 props = null;
+            } finally {
+                try {
+                    is.close();
+                } catch (IOException ignore) {
+                    // ignore
+                }
             }
         }
+
         return props;
     }
 

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to