Skip to content

Commit

Permalink
ARTEMIS-4746 Simplifying switch case on JMSExceptionHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed Apr 28, 2024
1 parent 614b5cb commit 8a08ee2
Showing 1 changed file with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,45 +39,30 @@ public static JMSException convertFromActiveMQException(final ActiveMQException
JMSException je;
switch (me.getType()) {
case CONNECTION_TIMEDOUT:
je = new JMSException(me.getMessage());
break;

case ILLEGAL_STATE:
je = new javax.jms.IllegalStateException(me.getMessage());
break;

case INTERNAL_ERROR:
je = new JMSException(me.getMessage());
break;

case INVALID_FILTER_EXPRESSION:
je = new InvalidSelectorException(me.getMessage());
break;

case NOT_CONNECTED:
je = new JMSException(me.getMessage());
break;

case UNSUPPORTED_PACKET:
case OBJECT_CLOSED:
case ILLEGAL_STATE:
je = new javax.jms.IllegalStateException(me.getMessage());
break;

case QUEUE_DOES_NOT_EXIST:
case QUEUE_EXISTS:
je = new InvalidDestinationException(me.getMessage());
break;

case QUEUE_EXISTS:
je = new InvalidDestinationException(me.getMessage());
case INVALID_FILTER_EXPRESSION:
je = new InvalidSelectorException(me.getMessage());
break;

case SECURITY_EXCEPTION:
je = new JMSSecurityException(me.getMessage());
break;

case UNSUPPORTED_PACKET:
je = new javax.jms.IllegalStateException(me.getMessage());
break;

case TRANSACTION_ROLLED_BACK:
je = new javax.jms.TransactionRolledBackException(me.getMessage());
break;
Expand Down

0 comments on commit 8a08ee2

Please sign in to comment.