mulesoft / apikit

APIkit is a tool for building REST APIs using MULE Runtime
Other
17 stars 52 forks source link

Various input streams not being closed by Scaffolder #490

Open abstratt opened 5 years ago

abstratt commented 5 years ago

It seems the Scaffolder does not close many of the input streams it opens.

This leads to files that cannot be deleted or otherwise opened by other processes on Windows, at least until the input stream is eventually garbage-collected.

Examples:

Note that JDOM's SAXParser does not close input stream used to build a document. See also #489 .

abstratt commented 5 years ago

One suggestion here would be to to close all streams opened in Scaffolder.createScaffolder() with a finally block that closes them all (even those that look like may be closed by called code - closing a stream that is already closed is a no-op).