Skip to content

Commit

Permalink
Added closing for Scanner in TextConfigurationRealm
Browse files Browse the repository at this point in the history
  • Loading branch information
pitjazz committed Mar 29, 2021
1 parent a85dfcd commit 0f72d5e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ protected void processUserDefinitions(Map<String, String> userDefs) {

protected static Set<String> toLines(String s) {
LinkedHashSet<String> set = new LinkedHashSet<String>();
Scanner scanner = new Scanner(s);
while (scanner.hasNextLine()) {
set.add(scanner.nextLine());
try (Scanner scanner = new Scanner(s)) {
while (scanner.hasNextLine()) {
set.add(scanner.nextLine());
}
}
return set;
}
Expand Down

0 comments on commit 0f72d5e

Please sign in to comment.