diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java index 117d0b647a..dba54c0d69 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/CommandParser.java @@ -49,21 +49,21 @@ class CommandParser { StompCommand command = null; if (line.startsWith(Stomp.Commands.CONNECT)) command = new Connect(format); - if (line.startsWith(Stomp.Commands.SUBSCRIBE)) + else if (line.startsWith(Stomp.Commands.SUBSCRIBE)) command = new Subscribe(format); - if (line.startsWith(Stomp.Commands.SEND)) + else if (line.startsWith(Stomp.Commands.SEND)) command = new Send(format); - if (line.startsWith(Stomp.Commands.DISCONNECT)) + else if (line.startsWith(Stomp.Commands.DISCONNECT)) command = new Disconnect(); - if (line.startsWith(Stomp.Commands.BEGIN)) + else if (line.startsWith(Stomp.Commands.BEGIN)) command = new Begin(format); - if (line.startsWith(Stomp.Commands.COMMIT)) + else if (line.startsWith(Stomp.Commands.COMMIT)) command = new Commit(format); - if (line.startsWith(Stomp.Commands.ABORT)) + else if (line.startsWith(Stomp.Commands.ABORT)) command = new Abort(format); - if (line.startsWith(Stomp.Commands.UNSUBSCRIBE)) + else if (line.startsWith(Stomp.Commands.UNSUBSCRIBE)) command = new Unsubscribe(format); - if (line.startsWith(Stomp.Commands.ACK)) + else if (line.startsWith(Stomp.Commands.ACK)) command = new Ack(format); if (command == null) {