Log in

View Full Version : What's wrong with this code? :)


mwtidd
29-02-2012, 07:00
Not really sure how I let this one sneak in.

public abstract class NeverEndingCommand extends Command{

protected void interrupted() {
//override for pids
}

protected boolean isFinished(){
return true;
}

protected void end(){
//never called
}
}

Cosine
03-03-2012, 10:17
It depends. What is the code supposed to do, and what is it currently doing?

gixxy
12-03-2012, 22:51
if it is returning true in isFinished() it will end every time it starts.

Change that to false and it will never end.