Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-12398

Bug in PollThread, mixing up expected nad actual when alerting listeners

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.0.0.Alpha1
    • 4.0.0.Alpha1
    • server
    • None

      There is currently only one implementer of the interface which is being misued, and that specific instance is not affected by the bug. This is a bug only discoverable via unit test. There is no behaviour change at all for it.

      The interface IPollResultListener has two methods:

      public void stateAsserted(boolean expectedState, boolean currentState);
      public void stateNotAsserted(boolean expectedState, boolean currentState);

      The PollThread class is misusing these methods, and instead calling with the parameters reversed. In the case of stateAsserted(bool, bool), this is not able to be noticed. In this case, it is saying the transition worked, so both values will be the same no matter what. Either expected is up or down, and, necessarily, the actual value will be the same as expected.

      In the case of stateNotAsserted, however, the ordering definitely matters. Either the server is up when it should be down, or it is down when it should be up. This difference matters.

            rob.stryker Rob Stryker (Inactive)
            rob.stryker Rob Stryker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: