1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bug Task#validate() gets called twice

Discussion in 'Developer Support' started by Savior, Dec 2, 2016.

  1. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Let's say task x is added like this: TaskBot#add(x). In this case, everything works as intended, x.validate() gets called once per loop.

    Now, there is a task y, which gets added with x.add(y)
    y.validate()
    gets called twice per loop (given that x validates, else it does not get called at all obviously).

    The execute() method only gets called once afterwards.

    I am 100% sure this is not caused by me, I tried setting up a barebones taskbot, and it still happens.

    Given the complexity of some validate methods, this can cause quite some unnecessary resource usage.

    @Cloud
     
    #1 Savior, Dec 2, 2016
    Last edited: Dec 2, 2016
    Derk likes this.
  2. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    #TreeBot

    EDIT: Why can't I like my own post?
     
  3. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Nevertheless this needs to be addressed.
     
  4. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    I think I've found the issue...
    --- Double Post Merged, Dec 3, 2016, Original Post Date: Dec 3, 2016 ---
    Although the fact that validate was called twice, and only executed once, means that the first validate returned false but the second returned true xD
     
    Savior likes this.

Share This Page

Loading...