Skip to content

Commit

Permalink
fix: fix an unclosed file reader issue
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Jun 14, 2024
1 parent c30db24 commit 64658c7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public static void saveCacheMapping() {
public static void readCacheMapping() {
File file = CACHE_ROOT_PATH.resolve("mapping.json").toFile();
if (file.exists()) {
try {
CACHE_MAP.putAll(JSONUtils.from(new FileReader(file), Map.class));
try (var reader = new FileReader(file)) {
CACHE_MAP.putAll(JSONUtils.from(reader, Map.class));
CACHE_MAP.trim();
} catch (IOException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 64658c7

Please sign in to comment.