| Summary: | NullPointerException thrown when executing output | ||
|---|---|---|---|
| Product: | Group 25 | Reporter: | yingtng4-c |
| Component: | Bug | Assignee: | yingtng4-c |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | enhancement | CC: | rmohan2-c, tingkpoon2-c |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Windows | ||
|
Description
yingtng4-c
2020-11-24 21:17:12 HKT
*** Bug 473 has been marked as a duplicate of this bug. *** Possible Solution by modifying Chef Class
Original
public void cook(int time)
{
if(remainingTime == 0 && isAvailable == true)
{
Output.output(this.order, time);
isAvailable = true;
this.processedCustomerOrder.add(this.order.getCustomer().getTokenNumber());
return;
}
else
{
remainingTime -= 1;
}
}
Changed to:
public void cook(int time)
{
if(remainingTime == 0 && isAvailable == false)
{
Output.output(this.order, time);
isAvailable = true;
this.processedCustomerOrder.add(this.order.getCustomer().getTokenNumber());
return;
}
else
{
remainingTime -= 1;
}
}
|