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

Use try-with-resources in DatasetUtil.java to close "src = new FileInputStream(tmpFile).getChannel();" and also "dest = new FileOutputStream(tmpFile).getChannel();" in method persistDatasetLogoToStorageAndCreateThumbnails(...) #10053

Closed
rtreacy opened this issue Oct 26, 2023 · 2 comments · Fixed by #10077
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: None No user-facing feature in particular hacktoberfest It's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJ Size: 3 A percentage of a sprint. 2.1 hours. Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc.
Milestone

Comments

@rtreacy
Copy link
Contributor

rtreacy commented Oct 26, 2023

No description provided.

@rtreacy rtreacy converted this from a draft issue Oct 26, 2023
@pdurbin pdurbin added Type: Suggestion an idea Component: Code Infrastructure formerly "Feature: Code Infrastructure" User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc. hacktoberfest It's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJ Feature: None No user-facing feature in particular labels Oct 26, 2023
@qqmyers
Copy link
Member

qqmyers commented Oct 26, 2023

Note that in #9669, I switched from using channels to streams because the channel.transferFrom method is not guaranteed to transfer all bytes (and can transfer 0 bytes) whereas the InputStream.transferTo method blocks until all bytes are transferred. I don't know if that's relevant here too (i.e. if this code also has that potential bug).

@bencomp
Copy link
Contributor

bencomp commented Oct 31, 2023

I was going to create a small separate PR for this, but I created a merge conflict and it was then easier to keep the fix as part of #10077. Reviews are welcome :)

@cmbz cmbz moved this to SPRINT- NEEDS SIZING in IQSS Dataverse Project Apr 1, 2024
@cmbz cmbz added the Size: 3 A percentage of a sprint. 2.1 hours. label Apr 1, 2024
@cmbz cmbz moved this from SPRINT- NEEDS SIZING to SPRINT READY in IQSS Dataverse Project Apr 1, 2024
@pdurbin pdurbin added this to the 6.4 milestone Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: None No user-facing feature in particular hacktoberfest It's Hacktoberfest! https://groups.google.com/g/dataverse-community/c/n_Nn_T2yA-w/m/BcoXO4tEAQAJ Size: 3 A percentage of a sprint. 2.1 hours. Type: Suggestion an idea User Role: Hackathon Participant Core developers, frequent contributors, drive-by contributors, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants