Skip to content

Commit

Permalink
Fix DefaultPropertiesParser resource close issue #1556
Browse files Browse the repository at this point in the history
  • Loading branch information
arvindkrishnakumar-okta committed Sep 20, 2024
1 parent 91a3e25 commit 962f364
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ public Map<String, String> parse(String source) {
return parse(scanner);
}

@SuppressWarnings("PMD.CloseResource")
@Override
public Map<String, String> parse(Resource resource) throws IOException {
Scanner scanner;
try (InputStream inputStream = resource.getInputStream()) {
scanner = new Scanner(inputStream, StandardCharsets.UTF_8.name());
}
InputStream is = resource.getInputStream();
Scanner scanner = new Scanner(is, StandardCharsets.UTF_8.name());
return parse(scanner);
}

Expand Down

0 comments on commit 962f364

Please sign in to comment.