ARTEMIS-4746 Simplifying switch case on JMSExceptionHelper

This commit is contained in:
Clebert Suconic 2024-04-28 14:32:07 -04:00 committed by Justin Bertram
parent 614b5cb32f
commit b50f01b02b
1 changed files with 7 additions and 22 deletions

View File

@ -39,45 +39,30 @@ public final class JMSExceptionHelper {
JMSException je;
switch (me.getType()) {
case CONNECTION_TIMEDOUT:
case INTERNAL_ERROR:
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 INTERNAL_ERROR:
je = new JMSException(me.getMessage());
case QUEUE_DOES_NOT_EXIST:
case QUEUE_EXISTS:
je = new InvalidDestinationException(me.getMessage());
break;
case INVALID_FILTER_EXPRESSION:
je = new InvalidSelectorException(me.getMessage());
break;
case NOT_CONNECTED:
je = new JMSException(me.getMessage());
break;
case OBJECT_CLOSED:
je = new javax.jms.IllegalStateException(me.getMessage());
break;
case QUEUE_DOES_NOT_EXIST:
je = new InvalidDestinationException(me.getMessage());
break;
case QUEUE_EXISTS:
je = new InvalidDestinationException(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;