You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Lorenz Quack (JIRA)" <ji...@apache.org> on 2016/07/20 14:18:20 UTC

[jira] [Created] (QPID-7358) [Java Broker] forbid the same state transition to be defined more than once

Lorenz Quack created QPID-7358:
----------------------------------

             Summary: [Java Broker] forbid the same state transition to be defined more than once
                 Key: QPID-7358
                 URL: https://issues.apache.org/jira/browse/QPID-7358
             Project: Qpid
          Issue Type: Bug
          Components: Java Broker
    Affects Versions: qpid-java-6.0, qpid-java-6.1, qpid-java-6.0.5
            Reporter: Lorenz Quack


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:
{code}@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()
{...}{code}
The relevant code that does the discarding is {{ConfiguredObjectTypeRegistry#addStateTransitions}} and {{ConfiguredObjectTypeRegistry#addStateTransition}}.

I would argue that this should be a compilation error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org