I used the Windows 10 OS, with eclipse editor version 2020-09. When I run the main class, the ArrayList of sorted CustomerOrder is successfully created. However, in the Kitchen class, the chef class's function cook() is invoked, and chef B is not assigned with an order, which caused the Order.CustomerOrder.getCustomer() function. Steps to reproduce the bug: Contents in myfile.txt: 0/crackers;beef,beef,fish;cake 5/crackers;fish;cake 3/crackers;beef,fish;cake 4/crackers;;cake 7/crackers;fish,beef,beef;cake Run the main class, and the error is as follows: Raw console output: crackersbeefbeeffishcakeOrder appended crackersfishcakeOrder appended crackersbeeffishcakeOrder appended crackerscakeOrder appended crackersfishbeefbeefcakeOrder appended chef Abby is cooking 42 chef Bobby is cooking 0 Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Order.CustomerOrder.getCustomer()" because "co" is null at MainSystem.Output.output(Output.java:8) at Persons.Chef.cook(Chef.java:34) at Kitchen.Kitchen.process(Kitchen.java:50) at MainSystem.Main.kitchenProcess(Main.java:31) at MainSystem.Main.main(Main.java:58)
I have refactored the code in the kitchen class, and I have pushed my changes to a branch called Alan/Modification.
*** This bug has been marked as a duplicate of bug 452 ***