apikit icon indicating copy to clipboard operation
apikit copied to clipboard

Various input streams not being closed by Scaffolder

Open abstratt opened this issue 6 years ago • 1 comments

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:

  • the domain input stream (here)
  • the RAML streams (here) - the XML streams seem to be closed.

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

abstratt avatar Jul 15 '19 22:07 abstratt

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

abstratt avatar Jul 16 '19 14:07 abstratt