diff --git a/out/production/VPR_SCRIPT/GeneralMethods.class b/out/production/VPR_SCRIPT/GeneralMethods.class index fc5fdc4..50de9ca 100644 Binary files a/out/production/VPR_SCRIPT/GeneralMethods.class and b/out/production/VPR_SCRIPT/GeneralMethods.class differ diff --git a/src/GeneralMethods.java b/src/GeneralMethods.java index 1167648..373ff18 100644 --- a/src/GeneralMethods.java +++ b/src/GeneralMethods.java @@ -41,13 +41,13 @@ public class GeneralMethods { * @param pathRead determines the filename of the file that will be read * @return menueList, userList, orderList depending on Data read */ - public ArrayList readData(String pathRead) { + public static ArrayList readData(String pathRead) { Path path = Paths.get(pathRead); try { List rows = Files.readAllLines(path); - if (pathRead == "menue.txt") { + if (pathRead.equals("menue.txt")) { ArrayList menueList = new ArrayList<>(); for (String row : rows) { @@ -64,7 +64,7 @@ public class GeneralMethods { } return menueList; - } else if (pathRead == "users.txt") { + } else if (pathRead.equals("users.txt")){ ArrayList userList = new ArrayList<>(); for (String row : rows) { @@ -79,7 +79,7 @@ public class GeneralMethods { } return userList; - } else if (pathRead == "orders.txt") { + } else if (pathRead.equals("orders.txt")) { ArrayList orderList = new ArrayList<>(); for (String row : rows) { @@ -113,9 +113,9 @@ public class GeneralMethods { * @param listToWrite determines which ArrayList is to be used for writing the file */ public void writeData2 (String pathWrite, ArrayList listToWrite){ - if (pathWrite == "users.txt") { + if (pathWrite.equals("users.txt")) { - } else if (pathWrite == "orders.txt") { + } else if (pathWrite.equals("orders.txt")) { } }