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

Add method to write class resource to manifest #157

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

mtdowling
Copy link
Member

Writing a class resource to a file manifest by calling
getClass().getResourceAsStream("...") will trip up static analysis tools
like SpotBugs since the InputStream is never closed. This commit adds
methods to write resources from a class into a FileManifest that avoid
this issue.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Writing a class resource to a file manifest by calling
getClass().getResourceAsStream("...") will trip up static analysis tools
like SpotBugs since the InputStream is never closed. This commit adds
methods to write resources from a class into a FileManifest that avoid
this issue.
*
* @param manifest Other object to merge with.
*/
default void addAllFiles(FileManifest manifest) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry about the churn, but these methods were wedged in between the other overloads of writeFile. Me adding two new methods made this divide even worse, so I went ahead and moved these.

@mtdowling mtdowling merged commit f790557 into master Sep 10, 2019
@mtdowling mtdowling deleted the add-class-resource-filemanifest branch September 19, 2019 05:29
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