From 86e702dfab56769ef6f74391ac96cd00ff23e717 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 12:35:46 +0200 Subject: [PATCH 01/13] manual code review - default cases --- .../src/Controll/Controller.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java index bf5c1d3..6a2b4e9 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java @@ -286,6 +286,7 @@ public static void pump(String[] cmd){ case "broken": tmp.setBroken(Boolean.parseBoolean(commands[i][1])); break; case "draw" : PumpDraw pd = new PumpDraw(Integer.parseInt(commands[i][1]), Integer.parseInt(commands[i][2])); ViewGame.setDrawsNames(pd, tmp); ViewGame.setDrawsReverseNames(tmp, pd); break; + default: break; } } objectNames.put(cmd[1], tmp); @@ -309,6 +310,7 @@ public static void pipe(String[] cmd){ case "dry": tmp.setFluid(Fluid.DRY); break; case "sticky": tmp.setFluid(Fluid.STICKY); break; case "slippery": tmp.setFluid(Fluid.SLIPPERY); break; + default: break; } break; case "rfluidtime": tmp.setFluidTime(Integer.parseInt(commands[i][1])); break; @@ -318,6 +320,7 @@ public static void pipe(String[] cmd){ case "leave": tmp.setLeave(Boolean.parseBoolean(commands[i][1])); break; case "draw" : PipeDraw pd = new PipeDraw(Integer.parseInt(commands[i][1]), Integer.parseInt(commands[i][2]), Integer.parseInt(commands[i][3]), Integer.parseInt(commands[i][4])); ViewGame.setDrawsNames(pd, tmp); ViewGame.setDrawsReverseNames(tmp, pd); break; + default: break; } } @@ -341,6 +344,7 @@ public static void cistern(String[] cmd){ case "water": tmp.setWater(Integer.parseInt(commands[0][1])); break; case "draw" : CisternDraw cd = new CisternDraw(Integer.parseInt(commands[i][1]), Integer.parseInt(commands[i][2])); ViewGame.setDrawsNames(cd, tmp); ViewGame.setDrawsReverseNames(tmp, cd); break; + default: break; } } objectNames.put(cmd[1], tmp); @@ -362,6 +366,8 @@ public static void spring(String[] cmd){ switch (commands[i][0]) { case "draw" : SpringDraw sd = new SpringDraw(Integer.parseInt(commands[i][1]), Integer.parseInt(commands[i][2])); ViewGame.setDrawsNames(sd, tmp); ViewGame.setDrawsReverseNames(tmp, sd); break; + default: break; + } } objectNames.put(cmd[1], tmp); @@ -403,6 +409,8 @@ public static void mechanic(String[] cmd){ case "pipe": tmp.setHoldingPipe((Pipe)objectNames.get(commands[i][1])); break; + default: break; + } } objectNames.put(cmd[1], tmp); @@ -433,6 +441,7 @@ public static void random(String[] cmd){ outResults.add("A véletlen események ki lettek kapcsolva."); break; case "true": random = true; outResults.add("A véletlen események be lettek kapcsolva."); break; + default: break; } }else { random=true; @@ -446,6 +455,8 @@ public static void random(String[] cmd){ System.out.println("A véletlen események ki lettek kapcsolva."); break; case "true": random = true; System.out.println("A véletlen események be lettek kapcsolva."); break; + default: break; + } }else { random=true; @@ -479,6 +490,7 @@ public static void show(String[] cmd){ if (test) outResults.add(objectReverseNames.get(p.getStandingField()).toString()); else System.out.println(objectReverseNames.get(p.getStandingField())); break; + default: break; } } /** From f96e583d8a007aeaeb487f98cc0e055953aaf7a9 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 12:40:24 +0200 Subject: [PATCH 02/13] manual code review - make collections final --- .../src/Controll/Controller.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java index 6a2b4e9..4ceedca 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java @@ -38,16 +38,16 @@ public class Controller { /** * Contains the names of the objects, the keys are the objects. */ - public static HashMap objectNames = new HashMap<>(); + public static final HashMap objectNames = new HashMap<>(); /** * Contains the objects, the keys are the names of the objects. */ - public static HashMap objectReverseNames = new HashMap<>(); + public static final HashMap objectReverseNames = new HashMap<>(); /** * WaterCounter of the game * */ - public static WaterCounter waterCounter = new WaterCounter(); + public static final WaterCounter waterCounter = new WaterCounter(); /** * True if the game is tested * */ @@ -78,12 +78,12 @@ public class Controller { /** * Current Player * */ - private static Player currentPlayer; + private static Player currentPlayer; /** * List of the commands * */ - public static ArrayList commandList = new ArrayList<>(); + public static final ArrayList commandList = new ArrayList<>(); /** * Number of new pumps with commands From 3b624016b4804a82b3b9cab87f0357ebd62f7dbd Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 13:13:55 +0200 Subject: [PATCH 03/13] =?UTF-8?q?SonarLint=20-=20replace=20print=C3=A9n=20?= =?UTF-8?q?with=20logger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Controll/Controller.java | 148 +++++++++--------- 1 file changed, 76 insertions(+), 72 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java index 4ceedca..4347c99 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java @@ -23,9 +23,13 @@ import java.util.Iterator; import java.util.Scanner; import java.util.regex.Pattern; +import java.util.logging.Level; +import java.util.logging.Logger; + @SuppressWarnings("DuplicatedCode") public class Controller { + static Logger logger = Logger.getLogger(Controller.class.getName()); /** * If true the game is random * */ @@ -170,7 +174,7 @@ public static void Run() throws FileNotFoundException { case("setpump"): setpump(cmd); break; case("restart"): restart(cmd); break; case("exit"): return; - default: System.out.println("Hibás parancs."); + default: logger.log(Level.INFO, "Hibás parancs."); } } } @@ -194,17 +198,17 @@ public static void Game() throws FileNotFoundException { switch(cmd[0]) { case("show"): show(cmd); break; case("showobject"): showobject(cmd); break; - case("move"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else move(cmd); break; - case("breakfield"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else breakfield(cmd); break; - case("repair"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else repair(cmd); break; - case("placepump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else placepump(cmd); break; - case("set"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else set(cmd); break; - case("disconnect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else disconnect(cmd); break; - case("connect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else connect(cmd); break; - case("getpump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else getpump(cmd); break; - case("pickuppipe"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!");else pickuppipe(cmd); break; - case("makesticky"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else makesticky(cmd); break; - case("makeslippery"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) System.out.println("Nem te vagy a soron következő játékos!"); else makeslippery(cmd); break; + case("move"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else move(cmd); break; + case("breakfield"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else breakfield(cmd); break; + case("repair"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else repair(cmd); break; + case("placepump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else placepump(cmd); break; + case("set"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else set(cmd); break; + case("disconnect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else disconnect(cmd); break; + case("connect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else connect(cmd); break; + case("getpump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else getpump(cmd); break; + case("pickuppipe"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!");else pickuppipe(cmd); break; + case("makesticky"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else makesticky(cmd); break; + case("makeslippery"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else makeslippery(cmd); break; case("save"): save(cmd); break; case("testall"): testAll(cmd); break; case("list"): list(); break; @@ -217,7 +221,7 @@ public static void Game() throws FileNotFoundException { case("setpump"): setpump(cmd); break; case("restart"): restart(cmd); break; case("exit"): return; - default: System.out.println("Hibás parancs."); + default: logger.log(Level.INFO, "Hibás parancs."); } if (moves == activePlayers.size()) { moves = 0; @@ -232,7 +236,7 @@ public static void Game() throws FileNotFoundException { public static void load(String cmd){ try { outResults.clear(); - System.out.println(cmd); + logger.log(Level.INFO, cmd); Scanner scanner = new Scanner(new File(cmd)); filePath = cmd; String separator = "\\"; @@ -240,13 +244,13 @@ public static void load(String cmd){ fileName = tmp[tmp.length-1]; while (scanner.hasNextLine()){ commandList.add(scanner.nextLine()); - System.out.println(commandList.get(commandList.size()-1)); + logger.log(Level.INFO, commandList.get(commandList.size()-1)); } if (test) { commandList.add("save " + filePath.replace(".in", ".out")); } } catch (FileNotFoundException e) { - System.out.println("Nem található a fájl!"); + logger.log(Level.INFO, "Nem található a fájl!"); } } @@ -261,7 +265,7 @@ public static void loadFileFromSrcToReader(String fileNameToOpen) { String line = ""; while ((line = br.readLine()) != null) { - System.out.println(line); + logger.log(Level.INFO, line); } // Closes the reader input.close(); @@ -292,7 +296,7 @@ public static void pump(String[] cmd){ objectNames.put(cmd[1], tmp); objectReverseNames.put(tmp, cmd[1]); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for creating a pipe. @@ -328,7 +332,7 @@ public static void pipe(String[] cmd){ objectReverseNames.put(tmp, cmd[1]); waterCounter.addPipe(tmp); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for creating a cistern. @@ -351,7 +355,7 @@ public static void cistern(String[] cmd){ objectReverseNames.put(tmp, cmd[1]); waterCounter.addCistern(tmp); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for creating a spring. @@ -373,7 +377,7 @@ public static void spring(String[] cmd){ objectNames.put(cmd[1], tmp); objectReverseNames.put(tmp, cmd[1]); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for creating a saboteur. @@ -386,7 +390,7 @@ public static void saboteur(String[] cmd){ objectNames.put(cmd[1], tmp); objectReverseNames.put(tmp, cmd[1]); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); activePlayers.add(tmp); } /** @@ -416,7 +420,7 @@ public static void mechanic(String[] cmd){ objectNames.put(cmd[1], tmp); objectReverseNames.put(tmp, cmd[1]); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); activePlayers.add(tmp); } /** @@ -428,7 +432,7 @@ public static void connectpipe(String[] cmd){ pipe.setFields(activeField); activeField.addPipe(pipe); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for switching random off and on. @@ -452,15 +456,15 @@ public static void random(String[] cmd){ if(cmd.length == 2){ switch (cmd[1]){ case "false": random = false; - System.out.println("A véletlen események ki lettek kapcsolva."); break; + logger.log(Level.INFO, "A véletlen események ki lettek kapcsolva."); break; case "true": random = true; - System.out.println("A véletlen események be lettek kapcsolva."); break; + logger.log(Level.INFO, "A véletlen események be lettek kapcsolva."); break; default: break; } }else { random=true; - System.out.println("A véletlen események be lettek kapcsolva."); + logger.log(Level.INFO, "A véletlen események be lettek kapcsolva."); } } @@ -472,7 +476,7 @@ public static void create() { objectNames.put("wc", waterCounter); objectReverseNames.put(waterCounter, "wc"); if (test) outResults.add("A pálya létrehozása sikeresen lezajlott. Kezdődhet a játék!"); - else System.out.println("A pálya létrehozása sikeresen lezajlott. Kezdődhet a játék!"); + else logger.log(Level.INFO, "A pálya létrehozása sikeresen lezajlott. Kezdődhet a játék!"); if(!test) gameMode = true; } /** @@ -484,11 +488,11 @@ public static void show(String[] cmd){ switch (commands[1]){ case "player": if (test) outResults.add(p.toString()); - else System.out.println(p); + else logger.log(Level.INFO, p.toString()); break; case "field": if (test) outResults.add(objectReverseNames.get(p.getStandingField()).toString()); - else System.out.println(objectReverseNames.get(p.getStandingField())); + else logger.log(Level.INFO, objectReverseNames.get(p.getStandingField())); break; default: break; } @@ -499,7 +503,7 @@ public static void show(String[] cmd){ public static void showobject(String[] cmd){ Object object = objectNames.get(cmd[1]); if (test) outResults.add(object.toString()); - else System.out.println(object.toString()); + else logger.log(Level.INFO, object.toString()); } /** * Function for moving a player to a field. @@ -511,11 +515,11 @@ public static void move(String[] cmd){ if(neighbors.contains(f)) { if (p.move(f)) { if (test) {outResults.add("Sikeres művelet");lastResult = true;} - else {System.out.println("Sikeres művelet");lastResult = true;} + else {logger.log(Level.INFO, "Sikeres művelet");lastResult = true;} } else { if (test) {outResults.add("Sikertelen művelet");lastResult = false;} else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); lastResult = false; moves--; } @@ -524,7 +528,7 @@ public static void move(String[] cmd){ else{ if (test) {outResults.add("Sikertelen művelet");lastResult = false;} else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); lastResult = false; moves--; } @@ -537,11 +541,11 @@ public static void breakfield(String[] cmd){ Player p = (Player)objectNames.get(cmd[1]); if(p.breakField()){ if (test) {outResults.add("Sikeres művelet"); lastResult = true;} - else {System.out.println("Sikeres művelet");lastResult = true;} + else {logger.log(Level.INFO, "Sikeres művelet");lastResult = true;} }else { if (test) {outResults.add("Sikertelen művelet"); lastResult = false;} else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); lastResult = false; moves--; } @@ -555,12 +559,12 @@ public static void repair(String[] cmd){ if(p.repair()){ lastResult = true; if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -615,12 +619,12 @@ public static void placepump(String[] cmd){ oldPipeD.setCoords(newPumpD, pumpBD); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -633,12 +637,12 @@ public static void set(String[] cmd){ if(player.getStandingField().set((Pipe)objectNames.get(cmd[2]), (Pipe)objectNames.get(cmd[3]))){ lastResult = true; if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -651,12 +655,12 @@ public static void disconnect(String[] cmd){ if(player.disconnect((Pipe)objectNames.get(cmd[2]))){ lastResult = true; if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -682,12 +686,12 @@ public static void connect(String[] cmd){ pd.setCoords(fromPumpD, toPumpD); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -707,12 +711,12 @@ public static void getpump(String[] cmd){ if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -732,12 +736,12 @@ public static void pickuppipe(String[] cmd){ ViewGame.setDrawsReverseNames(newPipe, newPipeD); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -750,12 +754,12 @@ public static void makesticky(String[] cmd){ if(player.makeSticky()){ lastResult = true; if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -765,16 +769,16 @@ public static void makesticky(String[] cmd){ * */ public static void makeslippery(String[] cmd){ Player player = (Player)objectNames.get(cmd[1]); - System.out.println(cmd[1]); + logger.log(Level.INFO, cmd[1]); if(player.makeSlippery()){ lastResult = true; if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { lastResult = false; if (test) outResults.add("Sikertelen művelet"); else { - System.out.println("Sikertelen művelet"); + logger.log(Level.INFO, "Sikertelen művelet"); moves--; } } @@ -807,25 +811,25 @@ public static void save(String[] cmd) { String separator = "\\"; String[] tmp=cmd[1].replaceAll(Pattern.quote(separator), "\\\\").split("\\\\"); fileName = tmp[tmp.length-1]; - System.out.println("Test name: " + fileName.replace(".out", "")); + logger.log(Level.INFO, "Test name: " + fileName.replace(".out", "")); if (result.size() != expected.size()) { - System.out.println("Test failed. The 2 files do not have the same amount of lines."); + logger.log(Level.INFO, "Test failed. The 2 files do not have the same amount of lines."); return; } int errors = 0; if (result.size() > 0 && expected.size() > 0) { for (int i = 0; i < expected.size(); i++) { if (!result.get(i).equals(expected.get(i))) { - System.out.println("Error in line " + (i+1) + ".\nExpected: " + expected.get(i) + ", but got: " + result.get(i)); + logger.log(Level.INFO, "Error in line " + (i+1) + ".\nExpected: " + expected.get(i) + ", but got: " + result.get(i)); errors++; } } } if (errors == 0 && result.size() > 0 && expected.size() > 0) { - System.out.println("Test succeeded.\n"); + logger.log(Level.INFO, "Test succeeded.\n"); } else { - System.out.println("Test failed.\n"); + logger.log(Level.INFO, "Test failed.\n"); } pipes=pumps=0; waterCounter.reset(); @@ -857,8 +861,8 @@ public static void testAll(String[] cmd) { * */ public static void list(){ for (Object obj : objectNames.values()) { - System.out.print(objectReverseNames.get(obj) + " "); - } System.out.println(); + logger.log(Level.INFO, objectReverseNames.get(obj) + " "); + } logger.log(Level.INFO, ""); } /** * Function for putting a player on a field. @@ -868,10 +872,10 @@ public static void addplayer(String[] cmd) { Player p = (Player) objectNames.get(cmd[2]); if(f.accept(p) != null) { if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { if (test) outResults.add("Sikertelen művelet"); - else System.out.println("Sikertelen művelet"); + else logger.log(Level.INFO, "Sikertelen művelet"); } } @@ -879,7 +883,7 @@ public static void step(String[] cmd){ Steppable s = (Steppable)objectNames.get(cmd[1]); s.step(); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for ending a turn. @@ -897,7 +901,7 @@ public static void endturn(String[] cmd){ value.step(); } } - System.out.println("Sikeres művelet"); + logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for countig the points for the two sides. @@ -905,7 +909,7 @@ public static void endturn(String[] cmd){ public static void count(String[] cmd){ waterCounter.count(); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for restaring the game. @@ -917,7 +921,7 @@ public static void restart(String[] cmd){ waterCounter.reset(); test = false; pumps=pipes=0; - System.out.println("Sikeres művelet"); + logger.log(Level.INFO, "Sikeres művelet"); if(!test) gameMode = false; } /** @@ -926,7 +930,7 @@ public static void restart(String[] cmd){ public static void test(String[] cmd){ if(cmd[1].equals("true")) test=true; else if(cmd[1].equals("false")) test=false; - System.out.println("Sikeres művelet"); + logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for signaling to the watercounter that the game ended. @@ -934,7 +938,7 @@ public static void test(String[] cmd){ public static void setend(String[] cmd){ waterCounter.setEnd(); if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); } /** * Function for setting the in/out pipes of a pump. @@ -943,10 +947,10 @@ public static void setpump(String[] cmd){ Pump pump = (Pump)objectNames.get(cmd[1]); if(pump.set((Pipe)objectNames.get(cmd[2]), (Pipe)objectNames.get(cmd[3]))){ if (test) outResults.add("Sikeres művelet"); - else System.out.println("Sikeres művelet"); + else logger.log(Level.INFO, "Sikeres művelet"); }else { if (test) outResults.add("Sikertelen művelet"); - else System.out.println("Sikertelen művelet"); + else logger.log(Level.INFO, "Sikertelen művelet"); } } } From 8957c0b8f3f7b97246e72c092a2577589924f120 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 14:01:18 +0200 Subject: [PATCH 04/13] SonarLint - string resources, resource closeing --- .../06786101c6e81d4e175b6d1f0cbf6b55bbe068fc | 2 + .../0fc36c235a22100e0b58abe3d2ecf46b09039f3b | 2 + .../19faadbff8f29c060e84bc71422c87b8de932825 | 0 .../337921b067143f69e89694a9335e877941f50e7c | 2 + .../3b75dd6f2347637f58fb22d37520bdaf8666060f | 5 + .../5251f38072712b04b1168fe13a8b392d6ad27520 | 4 + .../6af08458783265d4d7382281c99354611c009257 | 82 ++++++ .../769d6629fff0fdb94f1e78aa6735a4b490f81699 | 6 + .../7d40ace53aaeed942375f629948f87787c0198ff | 82 ++++++ .../893092d474271d335e0ebfc18609c779120a4d47 | 0 .../8f13733f346721c3d39f03c75afe8fae5d6fe89f | 16 ++ .../a1b4f37ef3339681be2392cb551649f7032e1c0a | 2 + .../ae375a6ce4402ef772f382ecf7271f9224176e9b | 6 + .../b0a35953170be4147a2214de1ca272141d33fdfc | 2 + .../b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c | 4 + .../b76bd53b8e23eaba45b5b65d2234253e5bb00c43 | 9 + .../c102106332e2fd2e145a693c49961375b2149e8b | 30 +++ .../c34016a91f6adc856460a66117f98eb56fa9bc60 | 6 + .../c54a65a8aa872521a49fb1b930e279e872406c5f | 4 + .../cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 | 2 + .../cf351f97bf963cdb89cd3530846681f1431f344f | 3 + .../d0e7750a25948def48006badab655f90e5fe3c1b | 2 + .../dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab | 2 + .../e8ecca94b526deed330be938464b4a8ba804cd8c | 10 + .../eadc31d2a7231b561802e3f88cf817c28dc1f8f7 | 4 + .../.idea/sonarlint/issuestore/index.pb | 51 ++++ .../06786101c6e81d4e175b6d1f0cbf6b55bbe068fc | 0 .../0fc36c235a22100e0b58abe3d2ecf46b09039f3b | 0 .../19faadbff8f29c060e84bc71422c87b8de932825 | 0 .../337921b067143f69e89694a9335e877941f50e7c | 0 .../3b75dd6f2347637f58fb22d37520bdaf8666060f | 0 .../5251f38072712b04b1168fe13a8b392d6ad27520 | 0 .../6af08458783265d4d7382281c99354611c009257 | 0 .../769d6629fff0fdb94f1e78aa6735a4b490f81699 | 0 .../7d40ace53aaeed942375f629948f87787c0198ff | 0 .../893092d474271d335e0ebfc18609c779120a4d47 | 0 .../8f13733f346721c3d39f03c75afe8fae5d6fe89f | 0 .../a1b4f37ef3339681be2392cb551649f7032e1c0a | 0 .../ae375a6ce4402ef772f382ecf7271f9224176e9b | 0 .../b0a35953170be4147a2214de1ca272141d33fdfc | 0 .../b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c | 0 .../b76bd53b8e23eaba45b5b65d2234253e5bb00c43 | 0 .../c102106332e2fd2e145a693c49961375b2149e8b | 0 .../c34016a91f6adc856460a66117f98eb56fa9bc60 | 0 .../c54a65a8aa872521a49fb1b930e279e872406c5f | 0 .../cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 | 0 .../cf351f97bf963cdb89cd3530846681f1431f344f | 0 .../d0e7750a25948def48006badab655f90e5fe3c1b | 0 .../dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab | 0 .../e8ecca94b526deed330be938464b4a8ba804cd8c | 0 .../eadc31d2a7231b561802e3f88cf817c28dc1f8f7 | 0 .../sonarlint/securityhotspotstore/index.pb | 51 ++++ .../src/Controll/Controller.java | 239 +++++++++--------- .../StringResourceController.java | 12 + 54 files changed, 521 insertions(+), 119 deletions(-) create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/6/a/6af08458783265d4d7382281c99354611c009257 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/7/d/7d40ace53aaeed942375f629948f87787c0198ff create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/8/9/893092d474271d335e0ebfc18609c779120a4d47 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/3/337921b067143f69e89694a9335e877941f50e7c create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/6/a/6af08458783265d4d7382281c99354611c009257 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/d/7d40ace53aaeed942375f629948f87787c0198ff create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/9/893092d474271d335e0ebfc18609c779120a4d47 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/1/c102106332e2fd2e145a693c49961375b2149e8b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb create mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc new file mode 100644 index 0000000..1e1a9f5 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc @@ -0,0 +1,2 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(؟ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b new file mode 100644 index 0000000..174f2f0 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b @@ -0,0 +1,2 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c new file mode 100644 index 0000000..174f2f0 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c @@ -0,0 +1,2 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f new file mode 100644 index 0000000..d8bd224 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f @@ -0,0 +1,5 @@ + + java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(J$2038565c-502a-4add-bb51-6fcb960741c2 + +java:S4144"YUpdate this method so that its implementation is not identical to "getWater" on line 171.(J$91b46505-8499-4d12-be4d-cbecfccf038f +w java:S1257"").(8˰1J$c40f1df6-0529-4377-8761-b526366ad38a + +java:S2293A"YReplace the type specification in this constructor call with the diamond operator ("<>").(͎8˰1J$d8b808cd-27d7-4247-abba-d59bddb49a35 + +java:S1319"lThe type of "objectDrawNames" should be an interface such as "Map" rather than the implementation "HashMap".(8˰1J$ceca9c81-7a2a-47ff-9d1a-547bb37b52d7 + +java:S1319"sThe type of "objectDrawReverseNames" should be an interface such as "Map" rather than the implementation "HashMap".(-8˰1J$4f9d2187-bd8b-4128-b75f-efc477d712ee + +java:S1319A"lThe type of "buttonToElement" should be an interface such as "Map" rather than the implementation "HashMap".(͎8˰1J$38f5bdb0-3b1b-4393-b4f8-1476bc0171c1 +p +java:S1604Q"(Make this anonymous inner class a lambda(ڬ8˰1J$cb790189-1265-4570-bdbc-dbfe322466a3 + +java:S1104"[Make objectDrawNames a static final constant or non-public and provide accessors if needed.(8˰1J$1e04e5e2-e2ef-43ff-a0c7-e1520b749bb7 + +java:S1104"bMake objectDrawReverseNames a static final constant or non-public and provide accessors if needed.(-8˰1J$65c4846d-15ea-4f67-8ab4-651f9c86a292 + +java:S1104 "NMake vg a static final constant or non-public and provide accessors if needed.(8˰1J$030f492b-d81b-4192-8c71-0f2899ddbf6c + +java:S1104A"[Make buttonToElement a static final constant or non-public and provide accessors if needed.(͎8˰1J$c2747680-1688-437a-9213-d53d765a6e43 + +java:S1104Q"ZMake selectListener a static final constant or non-public and provide accessors if needed.(ڬ8˰1J$01b4248d-8ebf-48f9-a38d-cb98b2b8d266 +} +java:S1444"5Make this "public static objectDrawNames" field final(8˰1J$0371ebc8-eb37-44a9-a974-0de8a50a81d6 +~ +java:S1444"").(J$13d512dc-bc36-491f-a263-1907ba8ec9d7 + +java:S2293;"YReplace the type specification in this constructor call with the diamond operator ("<>").(J$7ac07cf7-3843-4535-9d90-88f3ad54bbf0 + java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(؟J$989fdf1d-8fc7-465c-9724-4bcfb0fd74c4 + +java:S3252!"IUse static access with "javax.swing.WindowConstants" for "EXIT_ON_CLOSE".(J$3644d733-d183-4349-b4fe-094fb1c9f2ca \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b new file mode 100644 index 0000000..dbcda83 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b @@ -0,0 +1,30 @@ + + +java:S2293\"YReplace the type specification in this constructor call with the diamond operator ("<>").(J$bcd4584a-dd8c-4302-9d4e-3dc857f5e410 +Y +java:S1643"Use a StringBuilder instead.(熒J$57d8ba66-7072-4f07-88d5-bf752ecc9864 +X +java:S1643"Use a StringBuilder instead.(lJ$ae79b7eb-7ef7-4004-be49-1bfbeb934e87 + java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(J$dbaf58b8-3e92-4a88-9d3a-dbc11405edcd + +java:S2681"This line will not be executed conditionally; only the first line of this 2-line block will be. The rest will execute unconditionally.(J$c53ac70d-a3a4-4ebe-875b-eac58e46f4bd +` +java:S2119"Save and re-use this "Random".(J$71ccab2f-98b0-4deb-b38f-91d8dec65749 +[ +java:S2119"Save and re-use this "Random".(ŔJ$25021967-1918-4c80-939b-ef3e95c5fb82 +r +java:S1854"5Remove this useless assignment to local variable "r".(ŔJ$75344fde-a2f4-44c1-86ae-da1e225ce676 +[ +java:S2119"Save and re-use this "Random".(ŔJ$3a8a3415-df3c-43f1-9b3b-aaa11f545bb5 +c +java:S1481"&Remove this unused "r" local variable.(ŔJ$bde70c69-ac0d-450f-9dcd-f0fb08800bc2 +` +java:S2119"Save and re-use this "Random".(îJ$c5f1245d-f8d6-4d49-aac5-ef5d33f2e8fe +i +java:S1125"'Remove the unnecessary boolean literal.(ޛJ$0f81b316-b1a4-4dd3-82e9-1d96f4c8f6eb +` +java:S2119"Save and re-use this "Random".(J$81199bba-e038-4669-bed8-8b949476bf1f +` +java:S2119"Save and re-use this "Random".(J$56cc8d41-ddc9-4aab-8321-30b327f14961 +| +java:S1117":Rename "fields" which hides the field declared at line 40.(J$1576a721-affe-48b5-96f2-fa65d61774a2 \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 new file mode 100644 index 0000000..dbb2749 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 @@ -0,0 +1,6 @@ + +2 +java:S1643F"Use a StringBuilder instead.(熒 +7 +java:S1643P"Use a StringBuilder instead.( +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f new file mode 100644 index 0000000..703072c --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f @@ -0,0 +1,4 @@ + +t +java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(į +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 new file mode 100644 index 0000000..9218a52 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 @@ -0,0 +1,2 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(ȕǦ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f new file mode 100644 index 0000000..dd95715 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f @@ -0,0 +1,3 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ +c java:S100""NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(磛 \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b new file mode 100644 index 0000000..361aa92 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b @@ -0,0 +1,2 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab new file mode 100644 index 0000000..174f2f0 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab @@ -0,0 +1,2 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c new file mode 100644 index 0000000..e1474d3 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c @@ -0,0 +1,10 @@ + +2 +java:S1643g"Use a StringBuilder instead.(熒 +7 +java:S1643t"Use a StringBuilder instead.( +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( +4 +java:S2119'"Save and re-use this "Random".(Ŕ +4 +java:S21196"Save and re-use this "Random".(Ŕ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 new file mode 100644 index 0000000..64c8275 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 @@ -0,0 +1,4 @@ + +t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ +[ +java:S1659,"@Declare "toX" and all following declarations on a separate line.(д \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb new file mode 100644 index 0000000..1015ae2 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb @@ -0,0 +1,51 @@ + +L +src/Controll/Controller.java,7\d\7d40ace53aaeed942375f629948f87787c0198ff +F +src/Controll/Menu.java,b\7\b76bd53b8e23eaba45b5b65d2234253e5bb00c43 +L +src/Drawing/CisternDraw.java,d\c\dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab +J +src/Controll/ViewGame.java,6\a\6af08458783265d4d7382281c99354611c009257 +N +src/Controll/WaterCounter.java,0\6\06786101c6e81d4e175b6d1f0cbf6b55bbe068fc +I +src/Drawing/Drawable.java,c\f\cf351f97bf963cdb89cd3530846681f1431f344f +M +src/Drawing/MechanicDraw.java,0\f\0fc36c235a22100e0b58abe3d2ecf46b09039f3b +I +src/Drawing/PipeDraw.java,e\a\eadc31d2a7231b561802e3f88cf817c28dc1f8f7 +I +src/Drawing/PumpDraw.java,3\3\337921b067143f69e89694a9335e877941f50e7c +M +src/Drawing/SaboteurDraw.java,b\0\b0a35953170be4147a2214de1ca272141d33fdfc +K +src/Drawing/SpringDraw.java,a\1\a1b4f37ef3339681be2392cb551649f7032e1c0a +D +src/Enums/Fluid.java,c\d\cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 +Y +)src/Fields/ActiveFields/ActiveFields.java,c\5\c54a65a8aa872521a49fb1b930e279e872406c5f +T +$src/Fields/ActiveFields/Cistern.java,e\8\e8ecca94b526deed330be938464b4a8ba804cd8c +Q +!src/Fields/ActiveFields/Pump.java,8\f\8f13733f346721c3d39f03c75afe8fae5d6fe89f +S +#src/Fields/ActiveFields/Spring.java,c\3\c34016a91f6adc856460a66117f98eb56fa9bc60 +E +src/Fields/Field.java,3\b\3b75dd6f2347637f58fb22d37520bdaf8666060f +D +src/Fields/Pipe.java,c\1\c102106332e2fd2e145a693c49961375b2149e8b +M +src/Interfaces/Steppable.java,d\0\d0e7750a25948def48006badab655f90e5fe3c1b +I +src/Players/Mechanic.java,5\2\5251f38072712b04b1168fe13a8b392d6ad27520 +G +src/Players/Player.java,7\6\769d6629fff0fdb94f1e78aa6735a4b490f81699 +I +src/Players/Saboteur.java,a\e\ae375a6ce4402ef772f382ecf7271f9224176e9b += + src/palya.txt,8\9\893092d474271d335e0ebfc18609c779120a4d47 +[ ++src/StringResource/StringResourceController,1\9\19faadbff8f29c060e84bc71422c87b8de932825 +` +0src/StringResource/StringResourceController.java,b\3\b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/3/337921b067143f69e89694a9335e877941f50e7c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/3/337921b067143f69e89694a9335e877941f50e7c new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/6/a/6af08458783265d4d7382281c99354611c009257 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/6/a/6af08458783265d4d7382281c99354611c009257 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/d/7d40ace53aaeed942375f629948f87787c0198ff b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/d/7d40ace53aaeed942375f629948f87787c0198ff new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/9/893092d474271d335e0ebfc18609c779120a4d47 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/9/893092d474271d335e0ebfc18609c779120a4d47 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/1/c102106332e2fd2e145a693c49961375b2149e8b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/1/c102106332e2fd2e145a693c49961375b2149e8b new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 new file mode 100644 index 0000000..e69de29 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb new file mode 100644 index 0000000..1015ae2 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb @@ -0,0 +1,51 @@ + +L +src/Controll/Controller.java,7\d\7d40ace53aaeed942375f629948f87787c0198ff +F +src/Controll/Menu.java,b\7\b76bd53b8e23eaba45b5b65d2234253e5bb00c43 +L +src/Drawing/CisternDraw.java,d\c\dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab +J +src/Controll/ViewGame.java,6\a\6af08458783265d4d7382281c99354611c009257 +N +src/Controll/WaterCounter.java,0\6\06786101c6e81d4e175b6d1f0cbf6b55bbe068fc +I +src/Drawing/Drawable.java,c\f\cf351f97bf963cdb89cd3530846681f1431f344f +M +src/Drawing/MechanicDraw.java,0\f\0fc36c235a22100e0b58abe3d2ecf46b09039f3b +I +src/Drawing/PipeDraw.java,e\a\eadc31d2a7231b561802e3f88cf817c28dc1f8f7 +I +src/Drawing/PumpDraw.java,3\3\337921b067143f69e89694a9335e877941f50e7c +M +src/Drawing/SaboteurDraw.java,b\0\b0a35953170be4147a2214de1ca272141d33fdfc +K +src/Drawing/SpringDraw.java,a\1\a1b4f37ef3339681be2392cb551649f7032e1c0a +D +src/Enums/Fluid.java,c\d\cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 +Y +)src/Fields/ActiveFields/ActiveFields.java,c\5\c54a65a8aa872521a49fb1b930e279e872406c5f +T +$src/Fields/ActiveFields/Cistern.java,e\8\e8ecca94b526deed330be938464b4a8ba804cd8c +Q +!src/Fields/ActiveFields/Pump.java,8\f\8f13733f346721c3d39f03c75afe8fae5d6fe89f +S +#src/Fields/ActiveFields/Spring.java,c\3\c34016a91f6adc856460a66117f98eb56fa9bc60 +E +src/Fields/Field.java,3\b\3b75dd6f2347637f58fb22d37520bdaf8666060f +D +src/Fields/Pipe.java,c\1\c102106332e2fd2e145a693c49961375b2149e8b +M +src/Interfaces/Steppable.java,d\0\d0e7750a25948def48006badab655f90e5fe3c1b +I +src/Players/Mechanic.java,5\2\5251f38072712b04b1168fe13a8b392d6ad27520 +G +src/Players/Player.java,7\6\769d6629fff0fdb94f1e78aa6735a4b490f81699 +I +src/Players/Saboteur.java,a\e\ae375a6ce4402ef772f382ecf7271f9224176e9b += + src/palya.txt,8\9\893092d474271d335e0ebfc18609c779120a4d47 +[ ++src/StringResource/StringResourceController,1\9\19faadbff8f29c060e84bc71422c87b8de932825 +` +0src/StringResource/StringResourceController.java,b\3\b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java index 4347c99..63a0e01 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java @@ -12,6 +12,7 @@ import Players.Mechanic; import Players.Player; import Players.Saboteur; +import StringResource.StringResourceController; import javax.swing.text.View; import java.io.*; @@ -20,6 +21,7 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.Iterator; import java.util.Scanner; import java.util.regex.Pattern; @@ -42,12 +44,12 @@ public class Controller { /** * Contains the names of the objects, the keys are the objects. */ - public static final HashMap objectNames = new HashMap<>(); + public static final Map objectNames = new HashMap<>(); /** * Contains the objects, the keys are the names of the objects. */ - public static final HashMap objectReverseNames = new HashMap<>(); + public static final Map objectReverseNames = new HashMap<>(); /** * WaterCounter of the game * */ @@ -134,7 +136,7 @@ public static boolean changeActivePlayer(){ *Reads a command than calls a function to execute it. * */ public static void Run() throws FileNotFoundException { - while(commandList.size() != 0) { + while(!commandList.isEmpty()) { String command = commandList.get(0); commandList.remove(0); String[] cmd = command.split(" "); @@ -189,7 +191,7 @@ public static void Game() throws FileNotFoundException { activePlayers.remove(0); activePlayers.add(currentPlayer); Scanner stdInScanner = new Scanner(System.in); - if (commandList.size() == 0){ + if (commandList.isEmpty()){ commandList.add(stdInScanner.nextLine()); } String command = commandList.get(0); @@ -198,17 +200,17 @@ public static void Game() throws FileNotFoundException { switch(cmd[0]) { case("show"): show(cmd); break; case("showobject"): showobject(cmd); break; - case("move"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else move(cmd); break; - case("breakfield"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else breakfield(cmd); break; - case("repair"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else repair(cmd); break; - case("placepump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else placepump(cmd); break; - case("set"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else set(cmd); break; - case("disconnect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else disconnect(cmd); break; - case("connect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else connect(cmd); break; - case("getpump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else getpump(cmd); break; - case("pickuppipe"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!");else pickuppipe(cmd); break; - case("makesticky"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else makesticky(cmd); break; - case("makeslippery"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, "Nem te vagy a soron következő játékos!"); else makeslippery(cmd); break; + case("move"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else move(cmd); break; + case("breakfield"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else breakfield(cmd); break; + case("repair"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else repair(cmd); break; + case("placepump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else placepump(cmd); break; + case("set"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else set(cmd); break; + case("disconnect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else disconnect(cmd); break; + case("connect"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else connect(cmd); break; + case("getpump"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else getpump(cmd); break; + case("pickuppipe"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER);else pickuppipe(cmd); break; + case("makesticky"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else makesticky(cmd); break; + case("makeslippery"): moves++; if (!((Player)objectNames.get(cmd[1])).equals(currentPlayer)) logger.log(Level.INFO, StringResourceController.WRONG_PLAYER); else makeslippery(cmd); break; case("save"): save(cmd); break; case("testall"): testAll(cmd); break; case("list"): list(); break; @@ -234,10 +236,10 @@ public static void Game() throws FileNotFoundException { * Function for loading a file. * */ public static void load(String cmd){ - try { + try(Scanner scanner = new Scanner(new File(cmd))) { outResults.clear(); logger.log(Level.INFO, cmd); - Scanner scanner = new Scanner(new File(cmd)); + filePath = cmd; String separator = "\\"; String[] tmp=cmd.replaceAll(Pattern.quote(separator), "\\\\").split("\\\\"); @@ -258,20 +260,20 @@ public static void loadFileFromSrcToReader(String fileNameToOpen) { // a text file is located in src folder in the project Path rootDir = Paths.get(".").normalize().toAbsolutePath(); File file = new File(rootDir.toString() + "/" + fileNameToOpen); - try { - Reader input = new FileReader(file); + try( Reader input = new FileReader(file)) { + try (BufferedReader br = new BufferedReader(input)) { + // Checks if reader is ready - BufferedReader br = new BufferedReader(input); + String line = ""; while ((line = br.readLine()) != null) { logger.log(Level.INFO, line); } - // Closes the reader - input.close(); - } catch (IOException e) { - e.printStackTrace(); } + } catch (IOException e) { + e.printStackTrace(); + } } /** @@ -286,7 +288,7 @@ public static void pump(String[] cmd){ for(int i=0; i neighbors = p.getStandingField().getNeighborFields(); if(neighbors.contains(f)) { if (p.move(f)) { - if (test) {outResults.add("Sikeres művelet");lastResult = true;} - else {logger.log(Level.INFO, "Sikeres művelet");lastResult = true;} + if (test) {outResults.add(StringResourceController.GOOD_ACTION);lastResult = true;} + else {logger.log(Level.INFO, StringResourceController.GOOD_ACTION);lastResult = true;} } else { - if (test) {outResults.add("Sikertelen művelet");lastResult = false;} + if (test) {outResults.add(StringResourceController.WRONG_ACTION);lastResult = false;} else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); lastResult = false; moves--; } } } else{ - if (test) {outResults.add("Sikertelen művelet");lastResult = false;} + if (test) {outResults.add(StringResourceController.WRONG_ACTION);lastResult = false;} else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); lastResult = false; moves--; } @@ -540,12 +542,12 @@ public static void move(String[] cmd){ public static void breakfield(String[] cmd){ Player p = (Player)objectNames.get(cmd[1]); if(p.breakField()){ - if (test) {outResults.add("Sikeres művelet"); lastResult = true;} - else {logger.log(Level.INFO, "Sikeres művelet");lastResult = true;} + if (test) {outResults.add(StringResourceController.GOOD_ACTION); lastResult = true;} + else {logger.log(Level.INFO, StringResourceController.GOOD_ACTION);lastResult = true;} }else { - if (test) {outResults.add("Sikertelen művelet"); lastResult = false;} + if (test) {outResults.add(StringResourceController.WRONG_ACTION); lastResult = false;} else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); lastResult = false; moves--; } @@ -558,13 +560,13 @@ public static void repair(String[] cmd){ Player p = (Player)objectNames.get(cmd[1]); if(p.repair()){ lastResult = true; - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -618,13 +620,13 @@ public static void placepump(String[] cmd){ //redrawing the old pipe oldPipeD.setCoords(newPumpD, pumpBD); - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -636,13 +638,13 @@ public static void set(String[] cmd){ Player player = (Player)objectNames.get(cmd[1]); if(player.getStandingField().set((Pipe)objectNames.get(cmd[2]), (Pipe)objectNames.get(cmd[3]))){ lastResult = true; - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -654,13 +656,13 @@ public static void disconnect(String[] cmd){ Player player = (Player)objectNames.get(cmd[1]); if(player.disconnect((Pipe)objectNames.get(cmd[2]))){ lastResult = true; - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -685,13 +687,13 @@ public static void connect(String[] cmd){ Drawable fromPumpD = ViewGame.objectDrawReverseNames.get(standing); pd.setCoords(fromPumpD, toPumpD); - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -710,13 +712,13 @@ public static void getpump(String[] cmd){ lastResult = true; - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -735,13 +737,13 @@ public static void pickuppipe(String[] cmd){ ViewGame.setDrawsNames(newPipeD, newPipe); ViewGame.setDrawsReverseNames(newPipe, newPipeD); - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -753,13 +755,13 @@ public static void makesticky(String[] cmd){ Player player = (Player)objectNames.get(cmd[1]); if(player.makeSticky()){ lastResult = true; - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -772,13 +774,13 @@ public static void makeslippery(String[] cmd){ logger.log(Level.INFO, cmd[1]); if(player.makeSlippery()){ lastResult = true; - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { lastResult = false; - if (test) outResults.add("Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); else { - logger.log(Level.INFO, "Sikertelen művelet"); + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); moves--; } } @@ -795,7 +797,7 @@ public static void save(String[] cmd) { } } catch(FileNotFoundException e) { - + logger.log(Level.WARNING, StringResourceController.FILE_NOT_FOUND); } try { Scanner scannerResult = new Scanner(new File(cmd[1])); @@ -817,7 +819,7 @@ public static void save(String[] cmd) { return; } int errors = 0; - if (result.size() > 0 && expected.size() > 0) { + if (!result.isEmpty() && !expected.isEmpty()) { for (int i = 0; i < expected.size(); i++) { if (!result.get(i).equals(expected.get(i))) { logger.log(Level.INFO, "Error in line " + (i+1) + ".\nExpected: " + expected.get(i) + ", but got: " + result.get(i)); @@ -825,7 +827,7 @@ public static void save(String[] cmd) { } } } - if (errors == 0 && result.size() > 0 && expected.size() > 0) { + if (errors == 0 && !result.isEmpty() && !expected.isEmpty()) { logger.log(Level.INFO, "Test succeeded.\n"); } else { @@ -837,7 +839,7 @@ public static void save(String[] cmd) { objectReverseNames.clear(); } catch(FileNotFoundException e) { - + logger.log(Level.WARNING, StringResourceController.FILE_NOT_FOUND); } outResults.clear(); } @@ -845,15 +847,14 @@ public static void save(String[] cmd) { * Function for doing all the tests. * */ public static void testAll(String[] cmd) { - try { - Scanner scanner = new Scanner(new File(cmd[1] + "\\Alltests.txt")); + try(Scanner scanner = new Scanner(new File(cmd[1] + "\\Alltests.txt"))) { + while(scanner.hasNextLine()) { String line = scanner.nextLine(); load(cmd[1] + "\\" + line); } } catch (FileNotFoundException e) { - - + logger.log(Level.WARNING, StringResourceController.FILE_NOT_FOUND); } } /** @@ -871,19 +872,19 @@ public static void addplayer(String[] cmd) { Field f = (Field) objectNames.get(cmd[1]); Player p = (Player) objectNames.get(cmd[2]); if(f.accept(p) != null) { - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { - if (test) outResults.add("Sikertelen művelet"); - else logger.log(Level.INFO, "Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); + else logger.log(Level.INFO, StringResourceController.WRONG_ACTION); } } public static void step(String[] cmd){ Steppable s = (Steppable)objectNames.get(cmd[1]); s.step(); - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); } /** * Function for ending a turn. @@ -901,15 +902,15 @@ public static void endturn(String[] cmd){ value.step(); } } - logger.log(Level.INFO, "Sikeres művelet"); + logger.log(Level.INFO, StringResourceController.GOOD_ACTION); } /** * Function for countig the points for the two sides. * */ public static void count(String[] cmd){ waterCounter.count(); - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); } /** * Function for restaring the game. @@ -921,7 +922,7 @@ public static void restart(String[] cmd){ waterCounter.reset(); test = false; pumps=pipes=0; - logger.log(Level.INFO, "Sikeres művelet"); + logger.log(Level.INFO, StringResourceController.GOOD_ACTION); if(!test) gameMode = false; } /** @@ -929,16 +930,16 @@ public static void restart(String[] cmd){ * */ public static void test(String[] cmd){ if(cmd[1].equals("true")) test=true; - else if(cmd[1].equals("false")) test=false; - logger.log(Level.INFO, "Sikeres művelet"); + else if(cmd[1].equals(StringResourceController.FALSE)) test=false; + logger.log(Level.INFO, StringResourceController.GOOD_ACTION); } /** * Function for signaling to the watercounter that the game ended. * */ public static void setend(String[] cmd){ waterCounter.setEnd(); - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); } /** * Function for setting the in/out pipes of a pump. @@ -946,11 +947,11 @@ public static void setend(String[] cmd){ public static void setpump(String[] cmd){ Pump pump = (Pump)objectNames.get(cmd[1]); if(pump.set((Pipe)objectNames.get(cmd[2]), (Pipe)objectNames.get(cmd[3]))){ - if (test) outResults.add("Sikeres művelet"); - else logger.log(Level.INFO, "Sikeres művelet"); + if (test) outResults.add(StringResourceController.GOOD_ACTION); + else logger.log(Level.INFO, StringResourceController.GOOD_ACTION); }else { - if (test) outResults.add("Sikertelen művelet"); - else logger.log(Level.INFO, "Sikertelen művelet"); + if (test) outResults.add(StringResourceController.WRONG_ACTION); + else logger.log(Level.INFO, StringResourceController.WRONG_ACTION); } } } diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java new file mode 100644 index 0000000..c9039f9 --- /dev/null +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java @@ -0,0 +1,12 @@ +package StringResource; + +public final class StringResourceController { + public static final String FALSE = "false"; + public static final String FILE_NOT_FOUND = "File not found"; + public static final String WRONG_PLAYER = "Nem te vagy a soron következő játékos!"; + public static final String WRONG_ACTION = "Sikertelen művelet"; + public static final String GOOD_ACTION = "Sikeres művelet"; + public static final String WATER = "water"; + public static final String RANDOM_ON = "A véletlen események be lettek kapcsolva."; + +} \ No newline at end of file From 21cdbe88912ce4035d0f72fb31c94220ef469000 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 14:03:41 +0200 Subject: [PATCH 05/13] SonarLint - string resources, resource closeing --- .../.idea/.gitignore | 8 -- .../06786101c6e81d4e175b6d1f0cbf6b55bbe068fc | 2 - .../0fc36c235a22100e0b58abe3d2ecf46b09039f3b | 2 - .../19faadbff8f29c060e84bc71422c87b8de932825 | 0 .../337921b067143f69e89694a9335e877941f50e7c | 2 - .../3b75dd6f2347637f58fb22d37520bdaf8666060f | 5 -- .../5251f38072712b04b1168fe13a8b392d6ad27520 | 4 - .../6af08458783265d4d7382281c99354611c009257 | 82 ------------------- .../769d6629fff0fdb94f1e78aa6735a4b490f81699 | 6 -- .../7d40ace53aaeed942375f629948f87787c0198ff | 82 ------------------- .../893092d474271d335e0ebfc18609c779120a4d47 | 0 .../8f13733f346721c3d39f03c75afe8fae5d6fe89f | 16 ---- .../a1b4f37ef3339681be2392cb551649f7032e1c0a | 2 - .../ae375a6ce4402ef772f382ecf7271f9224176e9b | 6 -- .../b0a35953170be4147a2214de1ca272141d33fdfc | 2 - .../b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c | 4 - .../b76bd53b8e23eaba45b5b65d2234253e5bb00c43 | 9 -- .../c102106332e2fd2e145a693c49961375b2149e8b | 30 ------- .../c34016a91f6adc856460a66117f98eb56fa9bc60 | 6 -- .../c54a65a8aa872521a49fb1b930e279e872406c5f | 4 - .../cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 | 2 - .../cf351f97bf963cdb89cd3530846681f1431f344f | 3 - .../d0e7750a25948def48006badab655f90e5fe3c1b | 2 - .../dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab | 2 - .../e8ecca94b526deed330be938464b4a8ba804cd8c | 10 --- .../eadc31d2a7231b561802e3f88cf817c28dc1f8f7 | 4 - .../.idea/sonarlint/issuestore/index.pb | 51 ------------ .../06786101c6e81d4e175b6d1f0cbf6b55bbe068fc | 0 .../0fc36c235a22100e0b58abe3d2ecf46b09039f3b | 0 .../19faadbff8f29c060e84bc71422c87b8de932825 | 0 .../337921b067143f69e89694a9335e877941f50e7c | 0 .../3b75dd6f2347637f58fb22d37520bdaf8666060f | 0 .../5251f38072712b04b1168fe13a8b392d6ad27520 | 0 .../6af08458783265d4d7382281c99354611c009257 | 0 .../769d6629fff0fdb94f1e78aa6735a4b490f81699 | 0 .../7d40ace53aaeed942375f629948f87787c0198ff | 0 .../893092d474271d335e0ebfc18609c779120a4d47 | 0 .../8f13733f346721c3d39f03c75afe8fae5d6fe89f | 0 .../a1b4f37ef3339681be2392cb551649f7032e1c0a | 0 .../ae375a6ce4402ef772f382ecf7271f9224176e9b | 0 .../b0a35953170be4147a2214de1ca272141d33fdfc | 0 .../b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c | 0 .../b76bd53b8e23eaba45b5b65d2234253e5bb00c43 | 0 .../c102106332e2fd2e145a693c49961375b2149e8b | 0 .../c34016a91f6adc856460a66117f98eb56fa9bc60 | 0 .../c54a65a8aa872521a49fb1b930e279e872406c5f | 0 .../cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 | 0 .../cf351f97bf963cdb89cd3530846681f1431f344f | 0 .../d0e7750a25948def48006badab655f90e5fe3c1b | 0 .../dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab | 0 .../e8ecca94b526deed330be938464b4a8ba804cd8c | 0 .../eadc31d2a7231b561802e3f88cf817c28dc1f8f7 | 0 .../sonarlint/securityhotspotstore/index.pb | 51 ------------ .../bin/.idea/.gitignore | 0 54 files changed, 397 deletions(-) delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/.gitignore delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/6/a/6af08458783265d4d7382281c99354611c009257 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/7/d/7d40ace53aaeed942375f629948f87787c0198ff delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/8/9/893092d474271d335e0ebfc18609c779120a4d47 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/3/337921b067143f69e89694a9335e877941f50e7c delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/6/a/6af08458783265d4d7382281c99354611c009257 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/d/7d40ace53aaeed942375f629948f87787c0198ff delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/9/893092d474271d335e0ebfc18609c779120a4d47 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/1/c102106332e2fd2e145a693c49961375b2149e8b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb delete mode 100644 Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/bin/.idea/.gitignore diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/.gitignore b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc deleted file mode 100644 index 1e1a9f5..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc +++ /dev/null @@ -1,2 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(؟ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b deleted file mode 100644 index 174f2f0..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b +++ /dev/null @@ -1,2 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c deleted file mode 100644 index 174f2f0..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/3/337921b067143f69e89694a9335e877941f50e7c +++ /dev/null @@ -1,2 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f deleted file mode 100644 index d8bd224..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f +++ /dev/null @@ -1,5 +0,0 @@ - - java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(J$2038565c-502a-4add-bb51-6fcb960741c2 - -java:S4144"YUpdate this method so that its implementation is not identical to "getWater" on line 171.(J$91b46505-8499-4d12-be4d-cbecfccf038f -w java:S1257"").(8˰1J$c40f1df6-0529-4377-8761-b526366ad38a - -java:S2293A"YReplace the type specification in this constructor call with the diamond operator ("<>").(͎8˰1J$d8b808cd-27d7-4247-abba-d59bddb49a35 - -java:S1319"lThe type of "objectDrawNames" should be an interface such as "Map" rather than the implementation "HashMap".(8˰1J$ceca9c81-7a2a-47ff-9d1a-547bb37b52d7 - -java:S1319"sThe type of "objectDrawReverseNames" should be an interface such as "Map" rather than the implementation "HashMap".(-8˰1J$4f9d2187-bd8b-4128-b75f-efc477d712ee - -java:S1319A"lThe type of "buttonToElement" should be an interface such as "Map" rather than the implementation "HashMap".(͎8˰1J$38f5bdb0-3b1b-4393-b4f8-1476bc0171c1 -p -java:S1604Q"(Make this anonymous inner class a lambda(ڬ8˰1J$cb790189-1265-4570-bdbc-dbfe322466a3 - -java:S1104"[Make objectDrawNames a static final constant or non-public and provide accessors if needed.(8˰1J$1e04e5e2-e2ef-43ff-a0c7-e1520b749bb7 - -java:S1104"bMake objectDrawReverseNames a static final constant or non-public and provide accessors if needed.(-8˰1J$65c4846d-15ea-4f67-8ab4-651f9c86a292 - -java:S1104 "NMake vg a static final constant or non-public and provide accessors if needed.(8˰1J$030f492b-d81b-4192-8c71-0f2899ddbf6c - -java:S1104A"[Make buttonToElement a static final constant or non-public and provide accessors if needed.(͎8˰1J$c2747680-1688-437a-9213-d53d765a6e43 - -java:S1104Q"ZMake selectListener a static final constant or non-public and provide accessors if needed.(ڬ8˰1J$01b4248d-8ebf-48f9-a38d-cb98b2b8d266 -} -java:S1444"5Make this "public static objectDrawNames" field final(8˰1J$0371ebc8-eb37-44a9-a974-0de8a50a81d6 -~ -java:S1444"").(J$13d512dc-bc36-491f-a263-1907ba8ec9d7 - -java:S2293;"YReplace the type specification in this constructor call with the diamond operator ("<>").(J$7ac07cf7-3843-4535-9d90-88f3ad54bbf0 - java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(؟J$989fdf1d-8fc7-465c-9724-4bcfb0fd74c4 - -java:S3252!"IUse static access with "javax.swing.WindowConstants" for "EXIT_ON_CLOSE".(J$3644d733-d183-4349-b4fe-094fb1c9f2ca \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b deleted file mode 100644 index dbcda83..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/1/c102106332e2fd2e145a693c49961375b2149e8b +++ /dev/null @@ -1,30 +0,0 @@ - - -java:S2293\"YReplace the type specification in this constructor call with the diamond operator ("<>").(J$bcd4584a-dd8c-4302-9d4e-3dc857f5e410 -Y -java:S1643"Use a StringBuilder instead.(熒J$57d8ba66-7072-4f07-88d5-bf752ecc9864 -X -java:S1643"Use a StringBuilder instead.(lJ$ae79b7eb-7ef7-4004-be49-1bfbeb934e87 - java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(J$dbaf58b8-3e92-4a88-9d3a-dbc11405edcd - -java:S2681"This line will not be executed conditionally; only the first line of this 2-line block will be. The rest will execute unconditionally.(J$c53ac70d-a3a4-4ebe-875b-eac58e46f4bd -` -java:S2119"Save and re-use this "Random".(J$71ccab2f-98b0-4deb-b38f-91d8dec65749 -[ -java:S2119"Save and re-use this "Random".(ŔJ$25021967-1918-4c80-939b-ef3e95c5fb82 -r -java:S1854"5Remove this useless assignment to local variable "r".(ŔJ$75344fde-a2f4-44c1-86ae-da1e225ce676 -[ -java:S2119"Save and re-use this "Random".(ŔJ$3a8a3415-df3c-43f1-9b3b-aaa11f545bb5 -c -java:S1481"&Remove this unused "r" local variable.(ŔJ$bde70c69-ac0d-450f-9dcd-f0fb08800bc2 -` -java:S2119"Save and re-use this "Random".(îJ$c5f1245d-f8d6-4d49-aac5-ef5d33f2e8fe -i -java:S1125"'Remove the unnecessary boolean literal.(ޛJ$0f81b316-b1a4-4dd3-82e9-1d96f4c8f6eb -` -java:S2119"Save and re-use this "Random".(J$81199bba-e038-4669-bed8-8b949476bf1f -` -java:S2119"Save and re-use this "Random".(J$56cc8d41-ddc9-4aab-8321-30b327f14961 -| -java:S1117":Rename "fields" which hides the field declared at line 40.(J$1576a721-affe-48b5-96f2-fa65d61774a2 \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 deleted file mode 100644 index dbb2749..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 +++ /dev/null @@ -1,6 +0,0 @@ - -2 -java:S1643F"Use a StringBuilder instead.(熒 -7 -java:S1643P"Use a StringBuilder instead.( -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f deleted file mode 100644 index 703072c..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f +++ /dev/null @@ -1,4 +0,0 @@ - -t -java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(į -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 deleted file mode 100644 index 9218a52..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 +++ /dev/null @@ -1,2 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(ȕǦ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f deleted file mode 100644 index dd95715..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f +++ /dev/null @@ -1,3 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ -c java:S100""NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(磛 \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b deleted file mode 100644 index 361aa92..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b +++ /dev/null @@ -1,2 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab deleted file mode 100644 index 174f2f0..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab +++ /dev/null @@ -1,2 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c deleted file mode 100644 index e1474d3..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c +++ /dev/null @@ -1,10 +0,0 @@ - -2 -java:S1643g"Use a StringBuilder instead.(熒 -7 -java:S1643t"Use a StringBuilder instead.( -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.( -4 -java:S2119'"Save and re-use this "Random".(Ŕ -4 -java:S21196"Save and re-use this "Random".(Ŕ \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 deleted file mode 100644 index 64c8275..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 +++ /dev/null @@ -1,4 +0,0 @@ - -t java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(̋ -[ -java:S1659,"@Declare "toX" and all following declarations on a separate line.(д \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb deleted file mode 100644 index 1015ae2..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/issuestore/index.pb +++ /dev/null @@ -1,51 +0,0 @@ - -L -src/Controll/Controller.java,7\d\7d40ace53aaeed942375f629948f87787c0198ff -F -src/Controll/Menu.java,b\7\b76bd53b8e23eaba45b5b65d2234253e5bb00c43 -L -src/Drawing/CisternDraw.java,d\c\dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab -J -src/Controll/ViewGame.java,6\a\6af08458783265d4d7382281c99354611c009257 -N -src/Controll/WaterCounter.java,0\6\06786101c6e81d4e175b6d1f0cbf6b55bbe068fc -I -src/Drawing/Drawable.java,c\f\cf351f97bf963cdb89cd3530846681f1431f344f -M -src/Drawing/MechanicDraw.java,0\f\0fc36c235a22100e0b58abe3d2ecf46b09039f3b -I -src/Drawing/PipeDraw.java,e\a\eadc31d2a7231b561802e3f88cf817c28dc1f8f7 -I -src/Drawing/PumpDraw.java,3\3\337921b067143f69e89694a9335e877941f50e7c -M -src/Drawing/SaboteurDraw.java,b\0\b0a35953170be4147a2214de1ca272141d33fdfc -K -src/Drawing/SpringDraw.java,a\1\a1b4f37ef3339681be2392cb551649f7032e1c0a -D -src/Enums/Fluid.java,c\d\cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 -Y -)src/Fields/ActiveFields/ActiveFields.java,c\5\c54a65a8aa872521a49fb1b930e279e872406c5f -T -$src/Fields/ActiveFields/Cistern.java,e\8\e8ecca94b526deed330be938464b4a8ba804cd8c -Q -!src/Fields/ActiveFields/Pump.java,8\f\8f13733f346721c3d39f03c75afe8fae5d6fe89f -S -#src/Fields/ActiveFields/Spring.java,c\3\c34016a91f6adc856460a66117f98eb56fa9bc60 -E -src/Fields/Field.java,3\b\3b75dd6f2347637f58fb22d37520bdaf8666060f -D -src/Fields/Pipe.java,c\1\c102106332e2fd2e145a693c49961375b2149e8b -M -src/Interfaces/Steppable.java,d\0\d0e7750a25948def48006badab655f90e5fe3c1b -I -src/Players/Mechanic.java,5\2\5251f38072712b04b1168fe13a8b392d6ad27520 -G -src/Players/Player.java,7\6\769d6629fff0fdb94f1e78aa6735a4b490f81699 -I -src/Players/Saboteur.java,a\e\ae375a6ce4402ef772f382ecf7271f9224176e9b -= - src/palya.txt,8\9\893092d474271d335e0ebfc18609c779120a4d47 -[ -+src/StringResource/StringResourceController,1\9\19faadbff8f29c060e84bc71422c87b8de932825 -` -0src/StringResource/StringResourceController.java,b\3\b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/6/06786101c6e81d4e175b6d1f0cbf6b55bbe068fc deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/0/f/0fc36c235a22100e0b58abe3d2ecf46b09039f3b deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/1/9/19faadbff8f29c060e84bc71422c87b8de932825 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/3/337921b067143f69e89694a9335e877941f50e7c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/3/337921b067143f69e89694a9335e877941f50e7c deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/3/b/3b75dd6f2347637f58fb22d37520bdaf8666060f deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/5/2/5251f38072712b04b1168fe13a8b392d6ad27520 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/6/a/6af08458783265d4d7382281c99354611c009257 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/6/a/6af08458783265d4d7382281c99354611c009257 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/6/769d6629fff0fdb94f1e78aa6735a4b490f81699 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/d/7d40ace53aaeed942375f629948f87787c0198ff b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/7/d/7d40ace53aaeed942375f629948f87787c0198ff deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/9/893092d474271d335e0ebfc18609c779120a4d47 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/9/893092d474271d335e0ebfc18609c779120a4d47 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/8/f/8f13733f346721c3d39f03c75afe8fae5d6fe89f deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/1/a1b4f37ef3339681be2392cb551649f7032e1c0a deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/a/e/ae375a6ce4402ef772f382ecf7271f9224176e9b deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/0/b0a35953170be4147a2214de1ca272141d33fdfc deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/3/b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/b/7/b76bd53b8e23eaba45b5b65d2234253e5bb00c43 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/1/c102106332e2fd2e145a693c49961375b2149e8b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/1/c102106332e2fd2e145a693c49961375b2149e8b deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/3/c34016a91f6adc856460a66117f98eb56fa9bc60 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/5/c54a65a8aa872521a49fb1b930e279e872406c5f deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/d/cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/c/f/cf351f97bf963cdb89cd3530846681f1431f344f deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/0/d0e7750a25948def48006badab655f90e5fe3c1b deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/d/c/dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/8/e8ecca94b526deed330be938464b4a8ba804cd8c deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/e/a/eadc31d2a7231b561802e3f88cf817c28dc1f8f7 deleted file mode 100644 index e69de29..0000000 diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb deleted file mode 100644 index 1015ae2..0000000 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/.idea/sonarlint/securityhotspotstore/index.pb +++ /dev/null @@ -1,51 +0,0 @@ - -L -src/Controll/Controller.java,7\d\7d40ace53aaeed942375f629948f87787c0198ff -F -src/Controll/Menu.java,b\7\b76bd53b8e23eaba45b5b65d2234253e5bb00c43 -L -src/Drawing/CisternDraw.java,d\c\dc7d8911a5aacf8bdcdadf03c064b0e20ed754ab -J -src/Controll/ViewGame.java,6\a\6af08458783265d4d7382281c99354611c009257 -N -src/Controll/WaterCounter.java,0\6\06786101c6e81d4e175b6d1f0cbf6b55bbe068fc -I -src/Drawing/Drawable.java,c\f\cf351f97bf963cdb89cd3530846681f1431f344f -M -src/Drawing/MechanicDraw.java,0\f\0fc36c235a22100e0b58abe3d2ecf46b09039f3b -I -src/Drawing/PipeDraw.java,e\a\eadc31d2a7231b561802e3f88cf817c28dc1f8f7 -I -src/Drawing/PumpDraw.java,3\3\337921b067143f69e89694a9335e877941f50e7c -M -src/Drawing/SaboteurDraw.java,b\0\b0a35953170be4147a2214de1ca272141d33fdfc -K -src/Drawing/SpringDraw.java,a\1\a1b4f37ef3339681be2392cb551649f7032e1c0a -D -src/Enums/Fluid.java,c\d\cda172a0a5ac32b106ace8ccd7f6d63bad586dc3 -Y -)src/Fields/ActiveFields/ActiveFields.java,c\5\c54a65a8aa872521a49fb1b930e279e872406c5f -T -$src/Fields/ActiveFields/Cistern.java,e\8\e8ecca94b526deed330be938464b4a8ba804cd8c -Q -!src/Fields/ActiveFields/Pump.java,8\f\8f13733f346721c3d39f03c75afe8fae5d6fe89f -S -#src/Fields/ActiveFields/Spring.java,c\3\c34016a91f6adc856460a66117f98eb56fa9bc60 -E -src/Fields/Field.java,3\b\3b75dd6f2347637f58fb22d37520bdaf8666060f -D -src/Fields/Pipe.java,c\1\c102106332e2fd2e145a693c49961375b2149e8b -M -src/Interfaces/Steppable.java,d\0\d0e7750a25948def48006badab655f90e5fe3c1b -I -src/Players/Mechanic.java,5\2\5251f38072712b04b1168fe13a8b392d6ad27520 -G -src/Players/Player.java,7\6\769d6629fff0fdb94f1e78aa6735a4b490f81699 -I -src/Players/Saboteur.java,a\e\ae375a6ce4402ef772f382ecf7271f9224176e9b -= - src/palya.txt,8\9\893092d474271d335e0ebfc18609c779120a4d47 -[ -+src/StringResource/StringResourceController,1\9\19faadbff8f29c060e84bc71422c87b8de932825 -` -0src/StringResource/StringResourceController.java,b\3\b3116ebad5820dd15b51ead91d4bb3ec2a8f4d9c \ No newline at end of file diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/bin/.idea/.gitignore b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/bin/.idea/.gitignore deleted file mode 100644 index e69de29..0000000 From cd9f3c1fa95941cdc6bebf32ec516926ae9a7d40 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 14:15:16 +0200 Subject: [PATCH 06/13] SonarLint - decrease cognitive complexity from 16 to 15 --- .../src/Controll/Controller.java | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java index 63a0e01..0a5a50f 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java @@ -515,17 +515,7 @@ public static void move(String[] cmd){ Field f = (Field)objectNames.get(cmd[2]); ArrayList neighbors = p.getStandingField().getNeighborFields(); if(neighbors.contains(f)) { - if (p.move(f)) { - if (test) {outResults.add(StringResourceController.GOOD_ACTION);lastResult = true;} - else {logger.log(Level.INFO, StringResourceController.GOOD_ACTION);lastResult = true;} - } else { - if (test) {outResults.add(StringResourceController.WRONG_ACTION);lastResult = false;} - else { - logger.log(Level.INFO, StringResourceController.WRONG_ACTION); - lastResult = false; - moves--; - } - } + neighborsContains(p,f); } else{ if (test) {outResults.add(StringResourceController.WRONG_ACTION);lastResult = false;} @@ -536,6 +526,19 @@ public static void move(String[] cmd){ } } } + private static void neighborsContains(Player p, Field f){ + if (p.move(f)) { + if (test) {outResults.add(StringResourceController.GOOD_ACTION);lastResult = true;} + else {logger.log(Level.INFO, StringResourceController.GOOD_ACTION);lastResult = true;} + } else { + if (test) {outResults.add(StringResourceController.WRONG_ACTION);lastResult = false;} + else { + logger.log(Level.INFO, StringResourceController.WRONG_ACTION); + lastResult = false; + moves--; + } + } + } /** * Function for breaking a field by a player. * */ @@ -818,15 +821,7 @@ public static void save(String[] cmd) { logger.log(Level.INFO, "Test failed. The 2 files do not have the same amount of lines."); return; } - int errors = 0; - if (!result.isEmpty() && !expected.isEmpty()) { - for (int i = 0; i < expected.size(); i++) { - if (!result.get(i).equals(expected.get(i))) { - logger.log(Level.INFO, "Error in line " + (i+1) + ".\nExpected: " + expected.get(i) + ", but got: " + result.get(i)); - errors++; - } - } - } + int errors = getErros(result, expected); if (errors == 0 && !result.isEmpty() && !expected.isEmpty()) { logger.log(Level.INFO, "Test succeeded.\n"); } @@ -843,6 +838,19 @@ public static void save(String[] cmd) { } outResults.clear(); } + + private static int getErros(ArrayList result, ArrayList expected ){ + int errors = 0; + if (!result.isEmpty() && !expected.isEmpty()) { + for (int i = 0; i < expected.size(); i++) { + if (!result.get(i).equals(expected.get(i))) { + logger.log(Level.INFO, "Error in line " + (i+1) + ".\nExpected: " + expected.get(i) + ", but got: " + result.get(i)); + errors++; + } + } + } + return errors; + } /** * Function for doing all the tests. * */ From d7d070265de9fc00354244ee6965cbc83973ced8 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 14:33:54 +0200 Subject: [PATCH 07/13] SonarLint - menu issues --- .../src/Controll/Menu.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Menu.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Menu.java index 4cfdf93..bc1e2ae 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Menu.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Menu.java @@ -3,6 +3,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.Color; +import javax.swing.WindowConstants; import java.io.FileNotFoundException; @@ -30,7 +31,7 @@ public class Menu extends JFrame implements ActionListener { public Menu(String name, String t) { currentTheme = t; setTitle(name); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setResizable(false); setLayout(null); setBounds(700, 250, 500, 500); @@ -52,11 +53,11 @@ public Menu(String name, String t) { add(theme); Integer[] numOfMechanics = {2, 3, 4, 5, 6, 7, 8, 9}; - mechanics = new JComboBox(numOfMechanics); + mechanics = new JComboBox<>(numOfMechanics); mechanics.setBounds(300, 165, 40, 20); Integer[] numOfSaboteurs = {2, 3, 4, 5, 6, 7, 8, 9}; - saboteurs = new JComboBox(numOfSaboteurs); + saboteurs = new JComboBox<>(numOfSaboteurs); saboteurs.setBounds(300, 195, 40, 20); add(mechanics); @@ -133,13 +134,10 @@ public void actionPerformed(ActionEvent e) { Controller.commandList.add("addplayer D Sab" + i); } } - try { - Controller.Run(); // egyszer fut le, felépíti a pályát, utána a függvényeit kell majd hívni - } catch (FileNotFoundException ex) { - throw new RuntimeException(ex); - } + Controller.Run(); // egyszer fut le, felépíti a pályát, utána a függvényeit kell majd hívni + Controller.create(); - Controller.SetActivePlayer(Controller.getAllPlayers().get(0)); + Controller.setActivePlayer(Controller.getAllPlayers().get(0)); this.dispose(); ViewGame vg = new ViewGame(); vg.setBackgroundColor(currentTheme); From 37015fd6d04cfc8a843893671de14b7dfbe0075d Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 14:41:55 +0200 Subject: [PATCH 08/13] manual code review - remove commented code --- .../src/Fields/Field.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java index f1a4910..274cff1 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java @@ -52,9 +52,6 @@ public boolean isBroken() { * @return players. */ public ArrayList getPlayers() { //Basic getter if it is needed - /*if (players.size() == 0) { - return null; - }*/ return players; } From d9a39c301bdc458f5930f993f9d03acabc2bf44a Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 15:09:46 +0200 Subject: [PATCH 09/13] SonarLint - minor issues fixed --- .../src/Fields/ActiveFields/ActiveFields.java | 2 +- .../src/Fields/ActiveFields/Cistern.java | 8 +- .../src/Fields/ActiveFields/Pump.java | 81 +++++++++++-------- .../src/Fields/Field.java | 1 + .../src/Fields/Pipe.java | 28 +++---- .../src/Players/Mechanic.java | 2 +- .../src/Players/Player.java | 5 +- .../src/Players/Saboteur.java | 5 +- .../StringResourceController.java | 1 + 9 files changed, 71 insertions(+), 62 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/ActiveFields.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/ActiveFields.java index a2a421f..507b7be 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/ActiveFields.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/ActiveFields.java @@ -16,7 +16,7 @@ public abstract class ActiveFields extends Field { */ private ArrayList pipes = new ArrayList<>(); @Override - public ArrayList getNeighborFields(){ return new ArrayList(pipes);} + public ArrayList getNeighborFields(){ return new ArrayList<>(pipes);} /** * Getter for pipes. Only for child classes. * @return The pipes connected to the active field diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Cistern.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Cistern.java index b45c6b7..c7c6dda 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Cistern.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Cistern.java @@ -10,7 +10,7 @@ * Class for Cistern * */ public class Cistern extends ActiveFields{ - + private Random random = new Random(); /** * Last created Pipe. Null if the last pump was just taken. */ @@ -36,11 +36,10 @@ public void step() { } } if(createdPipe == null){ - Random r = new Random(); if(Controller.isTest()){ createdPipe = new Pipe(65); } - else createdPipe = new Pipe(30+r.nextInt(41)); + else createdPipe = new Pipe(30+random.nextInt(41)); } } @@ -51,12 +50,11 @@ public void step() { * */ @Override public Pump createNewPump(boolean b) { - Random r = new Random(); if(b){ if(Controller.isTest()){ return new Pump(100); } - else return new Pump(80+r.nextInt(41)); + else return new Pump(80+random.nextInt(41)); } else return null; } diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Pump.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Pump.java index 86de528..f629375 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Pump.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/ActiveFields/Pump.java @@ -12,7 +12,7 @@ * */ @SuppressWarnings("UnusedAssignment") public class Pump extends ActiveFields { - + private Random random = new Random(); /** * The amount of water in the tank. Default value is 0. */ @@ -73,23 +73,21 @@ public void setWaterTo(int waterTo) { @Override public void step() { super.step(); - if(!(super.isBroken())) { - if(waterTo != -1 && waterFrom != -1) { - super.setWater((this.getPipes().get(waterTo)).fillInWater(super.getWater())); - int newWater = (this.getPipes().get(waterFrom)).getWater(); - if(newWater < 0) this.getPipes().get(waterFrom).fillInWater(-newWater); - else{ - if(super.getWaterNoChange() + newWater > tank){ - super.setWater(tank); - this.getPipes().get(waterFrom).fillInWater(newWater-tank); - } - else super.setWater(super.getWaterNoChange() + newWater); - } - } + if(!(super.isBroken()) && waterTo != -1 && waterFrom != -1) { + super.setWater((this.getPipes().get(waterTo)).fillInWater(super.getWater())); + int newWater = (this.getPipes().get(waterFrom)).getWater(); + if(newWater < 0) this.getPipes().get(waterFrom).fillInWater(-newWater); + else{ + if(super.getWaterNoChange() + newWater > tank){ + super.setWater(tank); + this.getPipes().get(waterFrom).fillInWater(newWater-tank); + } + else super.setWater(super.getWaterNoChange() + newWater); + } } int r; if (!Controller.isTest()) { - r = new Random().nextInt(31); + r = random.nextInt(31); if(r < 3) { super.setBroken(true); @@ -126,29 +124,13 @@ public boolean repair() { */ @Override public String toString() { - ArrayList players = this.getPlayers(); - String playersNames = "null"; - for (int i = 0; i < players.size(); i++) { - if(i == 0) playersNames = ""; - playersNames += Controller.objectReverseNames.get(players.get(i)); - if (i != players.size() - 1) { - playersNames += ", "; - } - } + String playersNames = getPlayerNames(); - ArrayList pipes = this.getPipes(); - String pipesNames ="null"; - if(pipes != null) { - for (int i = 0; i < pipes.size(); i++) { - if (i == 0) pipesNames = ""; - pipesNames += Controller.objectReverseNames.get(pipes.get(i)); - if (i != pipes.size() - 1) { - pipesNames += ", "; - } - } - } + + + String pipesNames = getPipeNames(); String SWaterFrom=""; @@ -172,4 +154,33 @@ public String toString() { + "\nwaterFrom: " +SWaterFrom + "\nwaterTo: " +SWaterTo + "\n"; } + + private String getPlayerNames() { + ArrayList players = this.getPlayers(); + String playersNames = "null"; + for (int i = 0; i < players.size(); i++) { + if(i == 0) playersNames = ""; + playersNames += Controller.objectReverseNames.get(players.get(i)); + if (i != players.size() - 1) { + playersNames += ", "; + } + } + return playersNames; + } + + + private String getPipeNames(){ + ArrayList pipes = this.getPipes(); + String pipesNames ="null"; + if(pipes != null) { + for (int i = 0; i < pipes.size(); i++) { + if (i == 0) pipesNames = ""; + pipesNames += Controller.objectReverseNames.get(pipes.get(i)); + if (i != pipes.size() - 1) { + pipesNames += ", "; + } + } + } + return pipesNames; + } } diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java index 274cff1..b1eec75 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Field.java @@ -174,6 +174,7 @@ public int getWater() { * @return water in field. */ public int getWaterNoChange(){ + //It has different implementaion later return water; } diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Pipe.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Pipe.java index 8fda815..eba8320 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Pipe.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Fields/Pipe.java @@ -12,7 +12,7 @@ * Class for Pipes * */ public class Pipe extends Field { - + private final Random random = new Random(); /** * Capacity of the pipe */ @@ -89,7 +89,7 @@ public void setFluid(Fluid fluid) { * Getter for fields as Field. */ @Override - public ArrayList getNeighborFields(){ return new ArrayList(fields);} + public ArrayList getNeighborFields(){ return new ArrayList<>(fields);} /** * Getter for capacity. */ @@ -133,7 +133,7 @@ public boolean repair() { breakable = 5; } else { - breakable = 3+ new Random().nextInt(8); + breakable = 3+ random.nextInt(8); } return true; } @@ -145,7 +145,7 @@ public boolean repair() { */ @Override public Pipe placePump(Pump newPump) { - if(newPump == null) return null; + if(newPump == null) { return null; } ActiveFields oldPump = (ActiveFields) fields.remove(0); disconnect(oldPump); @@ -154,11 +154,10 @@ public Pipe placePump(Pump newPump) { oldPump.removePipe(this); Pipe newPipe; - Random r = new Random(); if(Controller.isTest()) { newPipe = new Pipe(50); } - else newPipe = new Pipe(30+r.nextInt(41)); + else newPipe = new Pipe(30+random.nextInt(41)); newPipe.connect(newPump); newPipe.connect(oldPump); @@ -240,13 +239,12 @@ public Field accept(Player p) { if(this.isOccupied()) return null; if(fluid == Fluid.SLIPPERY){ - Random r = new Random(); int index; if (Controller.isTest()) { index = 1; } else { - index = new Random().nextInt(2); + index = random.nextInt(2); } fields.get(index).accept(p); return fields.get(index); @@ -265,7 +263,7 @@ public Field accept(Player p) { */ public boolean removePlayer(Player p){ if(fluid == Fluid.STICKY){ - if(leave == true){ + if(leave){ leave = false; setOccupied(false); getPlayers().remove(p); @@ -288,7 +286,7 @@ public boolean makeSlippery(){ remainingFluidTime = 5; } else { - remainingFluidTime = 3+new Random().nextInt(3); + remainingFluidTime = 3+random.nextInt(3); } fluid = Fluid.SLIPPERY; return true; @@ -306,7 +304,7 @@ public boolean makeSticky(){ remainingFluidTime = 5; } else { - remainingFluidTime = 3+new Random().nextInt(3); + remainingFluidTime = 3+random.nextInt(3); } fluid = Fluid.STICKY; return true; @@ -348,12 +346,12 @@ public String toString() { } } - ArrayList fields = this.getFields(); + ArrayList loaclFields = this.getFields(); String fieldsNames ="null"; - for (int i = 0; i < fields.size(); i++) { + for (int i = 0; i < loaclFields.size(); i++) { if(i == 0) fieldsNames = ""; - fieldsNames += Controller.objectReverseNames.get(fields.get(i)); - if (i != fields.size() - 1) { + fieldsNames += Controller.objectReverseNames.get(loaclFields.get(i)); + if (i != loaclFields.size() - 1) { fieldsNames += ", "; } } diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Mechanic.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Mechanic.java index 4c89b8d..02e3881 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Mechanic.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Mechanic.java @@ -100,7 +100,7 @@ public boolean disconnect(Pipe p) { public boolean connect() { if(holdingPipe == null) return false; boolean result = super.getStandingField().addPipe(holdingPipe); - if(!result) return false; + if(!result){ return false; } boolean b = holdingPipe.connect((ActiveFields)super.getStandingField()); if(b) holdingPipe = null; return b; diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Player.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Player.java index 798d4e4..526b138 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Player.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Player.java @@ -25,7 +25,7 @@ public Field getStandingField() { /** * Constructor for the player. */ - public Player() { + protected Player() { } /** @@ -136,8 +136,7 @@ public boolean pickUpPipe() { * @return boolean - result of making the field sticky. True if successful. * */ public boolean makeSticky(){ - boolean result = standingField.makeSticky(); - return result; + return standingField.makeSticky(); } /** * Method for making the field where the player is standing slippery. diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Saboteur.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Saboteur.java index d7fc764..3458f84 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Saboteur.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Players/Saboteur.java @@ -12,6 +12,7 @@ public class Saboteur extends Player { * Constructor for the saboteur. */ public Saboteur() { + //Nothing can be inicialized here } /** @@ -19,8 +20,8 @@ public Saboteur() { * @return boolean - returns true if action was successful. */ public boolean makeSlippery(){ - boolean result = this.getStandingField().makeSlippery(); - return result; + return this.getStandingField().makeSlippery(); + } /** * Method for getting a string containing all the important information about the saboteur. diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java index c9039f9..dd33146 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/StringResource/StringResourceController.java @@ -1,6 +1,7 @@ package StringResource; public final class StringResourceController { + private StringResourceController(){} public static final String FALSE = "false"; public static final String FILE_NOT_FOUND = "File not found"; public static final String WRONG_PLAYER = "Nem te vagy a soron következő játékos!"; From 7046146e46677d74a6fc5aa185061200794fb74e Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 15:31:40 +0200 Subject: [PATCH 10/13] SonarLint - not critical issue fixes --- .../src/Controll/ViewGame.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java index e58f8cc..ace34eb 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java @@ -11,22 +11,24 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; +import java.util.List; import java.util.HashMap; +import java.util.Map; +import javax.swing.WindowConstans; public class ViewGame extends JFrame implements ActionListener { - private Controller controller; private static boolean isChosen = false; private JPanel gameBackground; /** * HashMap for the Drawables */ - public static HashMap objectDrawNames = new HashMap<>(); + public static final Map objectDrawNames = new HashMap<>(); /** * HashMap for the Drawables */ - public static HashMap objectDrawReverseNames = new HashMap<>(); + public static final Map objectDrawReverseNames = new HashMap<>(); public static ViewGame vg; @@ -58,11 +60,11 @@ public class ViewGame extends JFrame implements ActionListener { /** * ArrayList for the selected elements */ - static ArrayList selectSequence = new ArrayList(); //kiválasztott elemek, kiválasztásuk sorrendjében + static final List selectSequence = new ArrayList<>(); //kiválasztott elemek, kiválasztásuk sorrendjében /** * HashMap for the buttons */ - public static HashMap buttonToElement = new HashMap(); //kiválasztó gomb -> kiválasztott rajz + public static final Map buttonToElement = new HashMap<>(); //kiválasztó gomb -> kiválasztott rajz /** * Max number of rounds @@ -153,16 +155,16 @@ public static boolean getChosen(){ */ public ViewGame() { setTitle("Sivatagi vízhálózatok üzemeltetése a gyakorlatban 2"); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstans.EXIT_ON_CLOSE); setResizable(true); setBounds(400, 150, 1000, 700); setLayout(new BorderLayout()); gameBackground = new JPanel() { + @Override protected void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D)g; g2d.setColor(Color.black); super.paintComponent(g2d); - int i = 0; for (Drawable draw : objectDrawReverseNames.values()){ if (draw instanceof PipeDraw) { Pipe p = (Pipe)ViewGame.objectDrawNames.get(draw); @@ -233,18 +235,11 @@ protected void paintComponent(Graphics g) { vg = this; } - /** - * Sets the controller - * @param c - */ - public void setController(Controller c){ - controller = c; - } - /** * Paints the objects * @param g */ + @Override public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g; From 74e23d315f31b31a1875b9dc78711eced5478e45 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 15:32:41 +0200 Subject: [PATCH 11/13] SonarLint - mostly string and acces property issues remained --- .../src/Controll/Controller.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java index 0a5a50f..12d6f29 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/Controller.java @@ -20,6 +20,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.List; import java.util.HashMap; import java.util.Map; import java.util.Iterator; @@ -31,6 +32,7 @@ @SuppressWarnings("DuplicatedCode") public class Controller { + private Controller() {} static Logger logger = Logger.getLogger(Controller.class.getName()); /** * If true the game is random @@ -89,7 +91,7 @@ public class Controller { /** * List of the commands * */ - public static final ArrayList commandList = new ArrayList<>(); + public static final List commandList = new ArrayList<>(); /** * Number of new pumps with commands @@ -113,9 +115,9 @@ public static String getActivePlayerName(){ return objectReverseNames.get(currentPlayer); } - public static ArrayList getAllPlayers() { return activePlayers; } + public static List getAllPlayers() { return activePlayers; } - public static void SetActivePlayer(Player p) { currentPlayer = p; activePlayers.remove(0); activePlayers.add(currentPlayer); } + public static void setActivePlayer(Player p) { currentPlayer = p; activePlayers.remove(0); activePlayers.add(currentPlayer); } public static Player GetActivePlayer() { return currentPlayer; } @@ -135,7 +137,7 @@ public static boolean changeActivePlayer(){ *Function for controlling the game. *Reads a command than calls a function to execute it. * */ - public static void Run() throws FileNotFoundException { + public static void Run() { while(!commandList.isEmpty()) { String command = commandList.get(0); commandList.remove(0); @@ -580,7 +582,8 @@ public static void repair(String[] cmd){ public static void placepump(String[] cmd){ // |Pump A|===new=Pipe===|new Pump|===old=Pipe===|Pump B| Player p = (Player)objectNames.get(cmd[1]); //player - ActiveFields pumpA, pumpB; + ActiveFields pumpA; + ActiveFields pumpB; pumpA = pumpB = null; try { pumpA = ((Pipe)p.getStandingField()).getFields().get(0); From b268617b006da7f2afefbb1d06e8bdc3e9b1a127 Mon Sep 17 00:00:00 2001 From: Laci Date: Mon, 6 May 2024 15:37:18 +0200 Subject: [PATCH 12/13] fix missspelling --- .../src/Controll/ViewGame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java index ace34eb..e09e536 100644 --- a/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java +++ b/Sivatagi vizhalozatok uzemeltetese a gyakorlatban 2/src/Controll/ViewGame.java @@ -14,7 +14,7 @@ import java.util.List; import java.util.HashMap; import java.util.Map; -import javax.swing.WindowConstans; +import javax.swing.WindowConstants; public class ViewGame extends JFrame implements ActionListener { @@ -155,7 +155,7 @@ public static boolean getChosen(){ */ public ViewGame() { setTitle("Sivatagi vízhálózatok üzemeltetése a gyakorlatban 2"); - setDefaultCloseOperation(WindowConstans.EXIT_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setResizable(true); setBounds(400, 150, 1000, 700); setLayout(new BorderLayout()); From 918dd3ad2342c1c3c34e0951a3ff01655596d34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Muzslai?= <118824862+LaciProg@users.noreply.github.com> Date: Mon, 13 May 2024 17:04:50 +0200 Subject: [PATCH 13/13] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b96987..966678f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - Manuális-és-statikus-ellenőrzés pull_request: types: [opened, synchronize, reopened] jobs: