Go to Post FIRST is a life lesson on steroids. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-02-2012, 07:00
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
What's wrong with this code? :)

Not really sure how I let this one sneak in.

Code:
public abstract class NeverEndingCommand extends Command{

    protected void interrupted() {
        //override for pids
    }
    
    protected boolean isFinished(){
        return true;
    }
    
    protected void end(){
        //never called
    }
}
Reply With Quote
  #2   Spotlight this post!  
Unread 03-03-2012, 10:17
Cosine Cosine is offline
Registered User
FRC #1736 (Robot Casserole)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Peoria, IL
Posts: 2
Cosine is an unknown quantity at this point
Re: What's wrong with this code? :)

It depends. What is the code supposed to do, and what is it currently doing?
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2012, 22:51
gixxy's Avatar
gixxy gixxy is offline
Programming and Arduino Mentor
AKA: Gustave Michel III
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Ruston, LA
Posts: 207
gixxy is on a distinguished road
Re: What's wrong with this code? :)

if it is returning true in isFinished() it will end every time it starts.

Change that to false and it will never end.
__________________
Programmer - A creature known for converting Caffeine into Code.
Studying Computer Science @ Louisiana Tech University
Associate Consultant @ Fenway Group

2012-13: 3946 - Head of Programming, Electrical and Web
2014 - 3468 - Programming Mentor
2015 - Present - Lurker
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi