Skip to content

Commit

Permalink
use try-with-resources to close userLogFileStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Jefferson authored and eastlondoner committed Sep 25, 2018
1 parent 4657342 commit 7f270db
Showing 1 changed file with 13 additions and 9 deletions.
Expand Up @@ -242,15 +242,19 @@ private void doShutdown()
}
if ( userLogFileStream != null )
{
try
{
userLogFileStream.flush();
userLogFileStream.close();
}
catch ( IOException e )
{
throw new UncheckedIOException( e );
}
closeUserLogFileStream();
}
}

private void closeUserLogFileStream()
{
try ( OutputStream stream = userLogFileStream )
{
stream.flush();
}
catch ( IOException e )
{
throw new UncheckedIOException( e );
}
}

Expand Down

0 comments on commit 7f270db

Please sign in to comment.