Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-7358

[Java Broker] forbid the same state transition to be defined more than once

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • qpid-java-6.0, qpid-java-6.0.5, qpid-java-6.1
    • None
    • Broker-J
    • None

    Description

      Currently if we define a state transition more than once, only one will be used and the others will be silently discarded. For example on AbstractVirtualHost the state transition ERRORED -> ACTIVE is defined twice:

      @StateTransition(currentState = {State.UNINITIALIZED, State.ERRORED}, desiredState = State.ACTIVE)
      private ListenableFuture<Void> onActivate()
      {...}
      
      @StateTransition( currentState = { State.STOPPED, State.ERRORED }, desiredState = State.ACTIVE )
      private ListenableFuture<Void> onRestart()
      {...}

      The relevant code that does the discarding is ConfiguredObjectTypeRegistry#addStateTransitions and ConfiguredObjectTypeRegistry#addStateTransition.

      I would argue that this should be a compilation error.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lorenz.quack Lorenz Quack
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: