Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes file resource leak #1521

Merged
merged 3 commits into from
Sep 11, 2017
Merged

Conversation

tiagodrcarvalho
Copy link
Contributor

Wrap the output streams for the generated files inside a try-with-resources. Was preventing generated files from being deleted/moved while Spoon was still executing.

Wrap the output streams for the generated files inside a try-with-resources.
@pvojtechovsky pvojtechovsky merged commit ebd2bbf into INRIA:master Sep 11, 2017
@pvojtechovsky
Copy link
Collaborator

Thank You @tiagodrcarvalho for fix of this little, but critical problem! The file resource leaks are really not good ;-)

@tiagodrcarvalho
Copy link
Contributor Author

Hi @pvojtechovsky. I'm glad you accepted my fix!

We use spoon in a peculiar way (in a more "low-level" approach in which we work directly with the AST) and a feature we added in our work required a second execution of spoon (in the same Java execution) over the generated code, which lead to this resource leak (after some debugging).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants