From ad21b5b70b4bc34605291773ca424a31c57b41b5 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Mon, 15 Aug 2016 22:01:46 -0400 Subject: [PATCH] ARTEMIS-591 Fixing typos --- .../artemis/api/core/ActiveMQExceptionType.java | 13 ++++++------- ...ava => ActiveMQTransactionTimeoutException.java} | 6 +++--- .../core/transaction/impl/TransactionImpl.java | 6 +++--- 3 files changed, 12 insertions(+), 13 deletions(-) rename artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/{ActiveMQTranasactionTimeoutException.java => ActiveMQTransactionTimeoutException.java} (83%) diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java index 73616a8c3f..752574ae51 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java @@ -154,12 +154,6 @@ public enum ActiveMQExceptionType { return new ActiveMQTransactionOutcomeUnknownException(msg); } }, - TRANSACTION_TIMEOUT(116) { - @Override - public ActiveMQException createException(String msg) { - return new ActiveMQTranasactionTimeoutException(msg); - } - }, ALREADY_REPLICATING(116) { @Override public ActiveMQException createException(String msg) { @@ -184,7 +178,12 @@ public enum ActiveMQExceptionType { return new ActiveMQRemoteDisconnectException(msg); } }, - + TRANSACTION_TIMEOUT(120) { + @Override + public ActiveMQException createException(String msg) { + return new ActiveMQTransactionTimeoutException(msg); + } + }, GENERIC_EXCEPTION(999), NATIVE_ERROR_INTERNAL(200), NATIVE_ERROR_INVALID_BUFFER(201), diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTranasactionTimeoutException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTransactionTimeoutException.java similarity index 83% rename from artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTranasactionTimeoutException.java rename to artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTransactionTimeoutException.java index 753422f75a..5ca46f8f21 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTranasactionTimeoutException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTransactionTimeoutException.java @@ -17,13 +17,13 @@ package org.apache.activemq.artemis.api.core; -public class ActiveMQTranasactionTimeoutException extends ActiveMQException { +public class ActiveMQTransactionTimeoutException extends ActiveMQException { - public ActiveMQTranasactionTimeoutException() { + public ActiveMQTransactionTimeoutException() { super(ActiveMQExceptionType.TRANSACTION_TIMEOUT); } - public ActiveMQTranasactionTimeoutException(String message) { + public ActiveMQTransactionTimeoutException(String message) { super(ActiveMQExceptionType.TRANSACTION_TIMEOUT, message); } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java index 4148beceec..44e626a7dd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.ActiveMQExceptionType; import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException; -import org.apache.activemq.artemis.api.core.ActiveMQTranasactionTimeoutException; +import org.apache.activemq.artemis.api.core.ActiveMQTransactionTimeoutException; import org.apache.activemq.artemis.core.io.IOCallback; import org.apache.activemq.artemis.core.persistence.StorageManager; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; @@ -171,7 +171,7 @@ public class TransactionImpl implements Transaction { } if (timedout) { - markAsRollbackOnly(new ActiveMQTranasactionTimeoutException()); + markAsRollbackOnly(new ActiveMQTransactionTimeoutException()); } return timedout; @@ -180,7 +180,7 @@ public class TransactionImpl implements Transaction { @Override public boolean hasTimedOut() { - return state == State.ROLLBACK_ONLY && exception.getType() == ActiveMQExceptionType.TRANSACTION_TIMEOUT; + return state == State.ROLLBACK_ONLY && exception != null && exception.getType() == ActiveMQExceptionType.TRANSACTION_TIMEOUT; } @Override