Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094777

[Concurrency] Service#running() and other convenience methods are invoked before listeners of the state property.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u5
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
    • Environment:

      Windows 8.1 (64bit). Java 8u5 (64bit).

    • Subcomponent:

      Description

      The API for Service#running() says:

      bq. This method is invoked after any listeners of the state property and after the Task has been fully transitioned to the new state.

      It's the same for scheduled(), failed(), etc.. However, all of those convenience methods run before listener notification, not after. For me, the preferred behavior is the behavior described in the API.

      Here is an SSCCE using running() as an example: http://pastebin.com/Dzr3GLj9

      Expected output:

      OS: Windows 8.1
      Version: 1.8.0_05
      VM Info: 25.5-b02 (amd64)
      ----------------------------------------
      observed RUNNING
      running()

      Actual output:

      OS: Windows 8.1
      Version: 1.8.0_05
      VM Info: 25.5-b02 (amd64)
      ----------------------------------------
      running()
      observed RUNNING

      I'm not very familiar with the way the dispatching works, but Task looks very similar and functions correctly.

      For reference, here is a similar SSCCE for Task: http://pastebin.com/1hTAJh6K

        Attachments

          Activity

            People

            • Assignee:
              msladecek Martin Sládeček
              Reporter:
              rjjfx Ryan J (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: