HHH-9422 Making sure opened streams are closed
This commit is contained in:
parent
b3e4ba0b62
commit
f96da4e185
|
@ -139,6 +139,16 @@ public class JpaDescriptorParser {
|
|||
Diagnostic.Kind.WARNING, "Unable to parse persistence.xml: " + e.getMessage()
|
||||
);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
stream.close();
|
||||
}
|
||||
catch ( IOException e ) {
|
||||
context.logMessage(
|
||||
Diagnostic.Kind.WARNING, "Unable to close persistence.xml: " + e.getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
return persistence;
|
||||
}
|
||||
|
||||
|
@ -158,6 +168,16 @@ public class JpaDescriptorParser {
|
|||
Diagnostic.Kind.WARNING, "Unable to parse " + mappingFile + ": " + e.getMessage()
|
||||
);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
stream.close();
|
||||
}
|
||||
catch ( IOException e ) {
|
||||
context.logMessage(
|
||||
Diagnostic.Kind.WARNING, "Unable to close '" + mappingFile + "': " + e.getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
if ( mapping != null ) {
|
||||
entityMappings.add( mapping );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue