Skip to content

Commit

Permalink
Prevent file descriptor leak and modernize BufferedWriter creation
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot[bot] authored Aug 2, 2024
1 parent 5a4b5fa commit e472468
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private IHeaderMatcher subStringMatcher(String licenseFamilyCategory, String lic
private ClaimStatistic generateReport(ReportConfiguration config, File xmlReportFile) {
try {
Files.deleteIfExists(reportFile.get().getAsFile().toPath());
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(xmlReportFile));
BufferedWriter bufferedWriter = Files.newBufferedWriter(xmlReportFile.toPath());
return toXmlReportFile(config, bufferedWriter);
} catch (IOException | RatException exception) {
throw new GradleException("Cannot generate license header report for " + getPath(), exception);
Expand Down

0 comments on commit e472468

Please sign in to comment.