I'm getting the following error after running my code:
Any ideas on what causing that and how to fix it?
Here is Restore()
:
public void Restore() {
try
{
ObjectInputStream is = new ObjectInputStream(new FileInputStream("dump.out"));
GreenhouseControls greenhouseControls = (GreenhouseControls) is.readObject(); // Line 343
is.close();
Fixable fixable = getFixable(greenhouseControls.getError());
if(fixable != null)
fixable.fix();
else
System.out.println("Nothing to fix");
}
catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
}
Full code if needed: https://repl.it/repls/MajesticDarkredCrash#Main.java
example3.txt:
Event=ThermostatNight,time=0
Event=LightOn,time=2000
Event=WaterOff,time=10000
Event=ThermostatDay,time=12000
Event=Bell,time=9000,rings=5
Event=WaterOn,time=6000
Event=LightOff,time=4000
Event=Terminate,time=20000
Event=FansOn,time=7000
Event=WindowMalfunction,time=15000
Event=FansOff,time=8000
i'm using java GreenhouseCOntrols -f emample3.txt
then java GreenhouseControls -d dump.out
to run the program.