roxspring commented on a change in pull request #3:
URL:
https://github.com/apache/maven-resources-plugin/pull/3#discussion_r455799993
##########
File path:
src/test/java/org/apache/maven/plugins/resources/stub/MavenProjectBuildStub.java
##########
@@ -291,24 +291,18 @@ private void createFiles( String parent, String
testparent )
}
}
- private void populateFile( File file )
+ private void populateFile( File file ) throws IOException
{
- FileOutputStream outputStream;
String data = dataMap.get( file.getName() );
if ( ( data != null ) && file.exists() )
{
- try
+ try ( FileOutputStream outputStream = new FileOutputStream( file )
)
{
- outputStream = new FileOutputStream( file );
outputStream.write( data.getBytes() );
outputStream.flush();
outputStream.close();
Review comment:
The try-with-resources should handle the `close()` - this line is now
unnecessary.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]