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

SLING-9153 - MIME Type detection leaks temporary files when given a ZIP file #2

Merged
merged 2 commits into from Feb 27, 2020

Conversation

ankitaagar
Copy link
Contributor

SLING-9153 - MIME Type detection leaks temporary files when given a ZIP file

MediaType mediaType = detector.detect(stream, metadata);
MediaType mediaType;
TemporaryResources tmp = new TemporaryResources();
try {
Copy link
Member

@kwin kwin Feb 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html instead! BTW no need to close the PR, you can just add commits or force push to the existing branch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so I will put it like this
try (TemporaryResources tmp = new TemporaryResources()){ ...}
and remove the finally block
Is it fine?

@ankitaagar ankitaagar requested a review from kwin February 27, 2020 09:26
@kwin kwin merged commit cebf68b into apache:master Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants