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