Prefer Path.of() over Paths.get()

This commit is contained in:
P0nk
2022-08-11 19:01:40 +02:00
parent 297d5b25f0
commit d691dc1e18
13 changed files with 26 additions and 32 deletions

View File

@@ -10,7 +10,7 @@ import tools.exceptions.IdTypeNotSupportedException;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@@ -76,7 +76,7 @@ public class IdCommand extends Command {
throw new IdTypeNotSupportedException();
}
itemMap.put(type, new HashMap<>());
try (BufferedReader reader = Files.newBufferedReader(Paths.get(handbookDirectory.get(type)))) {
try (BufferedReader reader = Files.newBufferedReader(Path.of(handbookDirectory.get(type)))) {
String line;
while ((line = reader.readLine()) != null) {
String[] row = line.split(" - ", 2);