Skip to content

Commit

Permalink
use try with resources
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Lamy <olamy@apache.org>
  • Loading branch information
olamy committed Jun 30, 2021
1 parent efca2ce commit 5ea67ba
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,10 @@ protected final ModifiedPomXMLEventReader newModifiedPomXER( StringBuilder input
protected final void writeFile( File outFile, StringBuilder input )
throws IOException
{
Writer writer = WriterFactory.newXmlWriter( outFile );
try
try (Writer writer = WriterFactory.newXmlWriter( outFile ) )
{
IOUtil.copy( input.toString(), writer );
}
finally
{
IOUtil.close( writer );
}
}

/**
Expand Down

0 comments on commit 5ea67ba

Please sign in to comment.