diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/JpaDescriptorParser.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/JpaDescriptorParser.java index b93cff3923..bb9a99999e 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/JpaDescriptorParser.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/JpaDescriptorParser.java @@ -139,6 +139,13 @@ public class JpaDescriptorParser { Diagnostic.Kind.WARNING, "Unable to parse persistence.xml: " + e.getMessage() ); } + + try { + stream.close(); + } catch (IOException e) { + // eat it + } + return persistence; } @@ -161,6 +168,12 @@ public class JpaDescriptorParser { if ( mapping != null ) { entityMappings.add( mapping ); } + + try { + stream.close(); + } catch (IOException e) { + // eat it + } } }