Skip to content

Commit 544fd05

Browse files
committed
Use try-with-resources
1 parent 9d59793 commit 544fd05

File tree

1 file changed

+3
-3
lines changed
  • codegen-maven-plugin/src/main/java/software/amazon/awssdk/codegen/maven/plugin

1 file changed

+3
-3
lines changed

codegen-maven-plugin/src/main/java/software/amazon/awssdk/codegen/maven/plugin/GenerationMojo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ private <T> Optional<T> loadOptionalModel(Class<T> clzz, Path location) {
236236

237237
private void emitValidationReport(ModelValidationReport report) {
238238
Path modelsDir = sourcesDirectory.resolve("models");
239-
try {
240-
Writer writer = Files.newBufferedWriter(modelsDir.resolve("validation-report.json"),
241-
StandardCharsets.UTF_8);
239+
try (Writer writer = Files.newBufferedWriter(modelsDir.resolve("validation-report.json"),
240+
StandardCharsets.UTF_8);) {
241+
242242
Jackson.writeWithObjectMapper(report, writer);
243243
} catch (IOException e) {
244244
getLog().warn("Failed to write validation report to " + modelsDir, e);

0 commit comments

Comments
 (0)