InputStream leak from opening resources

Description

https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/JpaDescriptorParser.java#L128
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/xml/JpaDescriptorParser.java#L147

These lines should ensure the stream is closed no matter what since this code maybe used by a long running process that is the compiler (such as an IDE) and I would guess if you leak a file descriptor per orm.xml/persistence.xml after maybe 200 builds your IDE will stop working as it hits process limit.

Environment

Windows7 64but, JDK 8u25

Assignee

Brett Meyer

Reporter

Darryl Miles

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure