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: [email protected]
For additional commands, e-mail: [email protected]