Narrowed variables scope.

This commit is contained in:
vraskulin 2017-02-15 16:05:18 +03:00
parent 09da478b38
commit f1ef3bf68b
20 changed files with 42 additions and 60 deletions

View file

@ -45,7 +45,6 @@ public class SystemUtil {
public static void addCardsForTesting(Game game) {
try {
File f = new File(INIT_FILE_PATH);
Pattern pattern = Pattern.compile("([a-zA-Z]+):([\\w]+):([a-zA-Z ,\\/\\-.!'\\d:]+?):(\\d+)");
if (!f.exists()) {
logger.warn("Couldn't find init file: " + INIT_FILE_PATH);
return;
@ -54,6 +53,7 @@ public class SystemUtil {
logger.info("Parsing init.txt... ");
try (Scanner scanner = new Scanner(f)) {
Pattern pattern = Pattern.compile("([a-zA-Z]+):([\\w]+):([a-zA-Z ,\\/\\-.!'\\d:]+?):(\\d+)");
while (scanner.hasNextLine()) {
String line = scanner.nextLine().trim();
if (line.isEmpty() || line.startsWith("#")) {