You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ma...@apache.org on 2016/09/30 15:26:42 UTC
[42/52] [partial] activemq-artemis git commit: ARTEMIS-765 Improve
Checkstyle
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
index 0aa26ce..e94f51a 100644
--- a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
+++ b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
@@ -78,8 +78,7 @@ public class JDBCSequentialFileFactoryTest {
public void shutdownDerby() {
try {
DriverManager.getConnection("jdbc:derby:;shutdown=true");
- }
- catch (Exception ignored) {
+ } catch (Exception ignored) {
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java
index c7e514b..e4f83fa 100644
--- a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java
+++ b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallbackTest.java
@@ -34,6 +34,7 @@ public class JDBCJournalLoaderCallbackTest {
@Rule
public ThreadLeakCheckRule threadLeakCheckRule = new ThreadLeakCheckRule();
+
@Test
public void testAddDeleteRecord() throws Exception {
@@ -57,8 +58,7 @@ public class JDBCJournalLoaderCallbackTest {
public void shutdownDerby() {
try {
DriverManager.getConnection("jdbc:derby:;shutdown=true");
- }
- catch (Exception ignored) {
+ } catch (Exception ignored) {
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java
index 1cf038c..6c146f0 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/ActiveMQJMSClient.java
@@ -67,20 +67,15 @@ public class ActiveMQJMSClient {
ActiveMQConnectionFactory factory = null;
if (jmsFactoryType.equals(JMSFactoryType.CF)) {
factory = new ActiveMQJMSConnectionFactory(true, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
factory = new ActiveMQQueueConnectionFactory(true, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
factory = new ActiveMQTopicConnectionFactory(true, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
factory = new ActiveMQXAConnectionFactory(true, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
factory = new ActiveMQXAQueueConnectionFactory(true, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
factory = new ActiveMQXATopicConnectionFactory(true, groupConfiguration);
}
@@ -101,20 +96,15 @@ public class ActiveMQJMSClient {
ActiveMQConnectionFactory factory = null;
if (jmsFactoryType.equals(JMSFactoryType.CF)) {
factory = new ActiveMQJMSConnectionFactory(false, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
factory = new ActiveMQQueueConnectionFactory(false, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
factory = new ActiveMQTopicConnectionFactory(false, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
factory = new ActiveMQXAConnectionFactory(false, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
factory = new ActiveMQXAQueueConnectionFactory(false, groupConfiguration);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
factory = new ActiveMQXATopicConnectionFactory(false, groupConfiguration);
}
@@ -142,20 +132,15 @@ public class ActiveMQJMSClient {
ActiveMQConnectionFactory factory = null;
if (jmsFactoryType.equals(JMSFactoryType.CF)) {
factory = new ActiveMQJMSConnectionFactory(true, initialServers);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
factory = new ActiveMQQueueConnectionFactory(true, initialServers);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
factory = new ActiveMQTopicConnectionFactory(true, initialServers);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
factory = new ActiveMQXAConnectionFactory(true, initialServers);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
factory = new ActiveMQXAQueueConnectionFactory(true, initialServers);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
factory = new ActiveMQXATopicConnectionFactory(true, initialServers);
}
@@ -178,20 +163,15 @@ public class ActiveMQJMSClient {
ActiveMQConnectionFactory factory = null;
if (jmsFactoryType.equals(JMSFactoryType.CF)) {
factory = new ActiveMQJMSConnectionFactory(false, transportConfigurations);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_CF)) {
factory = new ActiveMQQueueConnectionFactory(false, transportConfigurations);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_CF)) {
factory = new ActiveMQTopicConnectionFactory(false, transportConfigurations);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.XA_CF)) {
factory = new ActiveMQXAConnectionFactory(false, transportConfigurations);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.QUEUE_XA_CF)) {
factory = new ActiveMQXAQueueConnectionFactory(false, transportConfigurations);
- }
- else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
+ } else if (jmsFactoryType.equals(JMSFactoryType.TOPIC_XA_CF)) {
factory = new ActiveMQXATopicConnectionFactory(false, transportConfigurations);
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConnectionInfo.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConnectionInfo.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConnectionInfo.java
index bca646c..64da481 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConnectionInfo.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConnectionInfo.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.artemis.api.jms.management;
-import org.apache.activemq.artemis.api.core.JsonUtil;
-
import javax.json.JsonArray;
import javax.json.JsonObject;
+import org.apache.activemq.artemis.api.core.JsonUtil;
+
public class JMSConnectionInfo {
private final String connectionID;
@@ -43,9 +43,7 @@ public class JMSConnectionInfo {
String cid = obj.containsKey("clientID") ? obj.getString("clientID") : null;
String uname = obj.containsKey("principal") ? obj.getString("principal") : null;
- JMSConnectionInfo info = new JMSConnectionInfo(obj.getString("connectionID"), obj.getString("clientAddress"),
- obj.getJsonNumber("creationTime").longValue(),
- cid, uname);
+ JMSConnectionInfo info = new JMSConnectionInfo(obj.getString("connectionID"), obj.getString("clientAddress"), obj.getJsonNumber("creationTime").longValue(), cid, uname);
infos[i] = info;
}
return infos;
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConsumerInfo.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConsumerInfo.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConsumerInfo.java
index 63fcdcd..5b7f5e3 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConsumerInfo.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSConsumerInfo.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.artemis.api.jms.management;
-import org.apache.activemq.artemis.api.core.JsonUtil;
-
import javax.json.JsonArray;
import javax.json.JsonObject;
+import org.apache.activemq.artemis.api.core.JsonUtil;
+
/**
* Helper class to create Java Objects from the
* JSON serialization returned by {@link JMSServerControl#listConsumersAsJSON(String)} and related methods.
@@ -54,10 +54,7 @@ public class JMSConsumerInfo {
JMSConsumerInfo[] infos = new JMSConsumerInfo[array.size()];
for (int i = 0; i < array.size(); i++) {
JsonObject sub = array.getJsonObject(i);
- JMSConsumerInfo info = new JMSConsumerInfo(sub.getJsonNumber("consumerID").toString(), sub.getString("connectionID"),
- sub.getString("destinationName"), sub.getString("destinationType"), sub.getBoolean("browseOnly"),
- sub.getJsonNumber("creationTime").longValue(),
- sub.getBoolean("durable"), sub.getString("filter", null));
+ JMSConsumerInfo info = new JMSConsumerInfo(sub.getJsonNumber("consumerID").toString(), sub.getString("connectionID"), sub.getString("destinationName"), sub.getString("destinationType"), sub.getBoolean("browseOnly"), sub.getJsonNumber("creationTime").longValue(), sub.getBoolean("durable"), sub.getString("filter", null));
infos[i] = info;
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java
index 2e785df..0e99106 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java
@@ -64,8 +64,7 @@ public class JMSManagementHelper {
final String operationName) throws JMSException {
try {
ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message), resourceName, operationName);
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSManagementHelper.convertFromException(e);
}
}
@@ -94,8 +93,7 @@ public class JMSManagementHelper {
final Object... parameters) throws JMSException {
try {
ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message), resourceName, operationName, parameters);
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw JMSManagementHelper.convertFromException(e);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSQueueControl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSQueueControl.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSQueueControl.java
index 6b9aedc..56a127c 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSQueueControl.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSQueueControl.java
@@ -16,10 +16,9 @@
*/
package org.apache.activemq.artemis.api.jms.management;
-import java.util.Map;
-
import javax.management.MBeanOperationInfo;
import javax.management.openmbean.CompositeData;
+import java.util.Map;
import org.apache.activemq.artemis.api.core.management.Attribute;
import org.apache.activemq.artemis.api.core.management.Operation;
@@ -200,7 +199,7 @@ public interface JMSQueueControl extends DestinationControl {
* Sends a TextMessage to the destination.
*
* @param properties the message properties to set as a comma sep name=value list. Can only
- * contain Strings maped to primitive types or JMS properties. eg: body=hi,JMSReplyTo=Queue2
+ * contain Strings maped to primitive types or JMS properties. eg: body=hi,JMSReplyTo=Queue2
* @return the message id of the message sent.
* @throws Exception
*/
@@ -212,17 +211,18 @@ public interface JMSQueueControl extends DestinationControl {
*
* @param headers the message headers and properties to set. Can only
* container Strings maped to primitive types.
- * @param body the text to send
+ * @param body the text to send
* @return the message id of the message sent.
* @throws Exception
*/
@Operation(desc = "Sends a TextMessage to a password-protected destination.", impact = MBeanOperationInfo.ACTION)
- String sendTextMessage(@Parameter(name = "headers") Map<String,String> headers,
+ String sendTextMessage(@Parameter(name = "headers") Map<String, String> headers,
@Parameter(name = "body") String body) throws Exception;
/**
* Sends a TextMesage to the destination.
- * @param body the text to send
+ *
+ * @param body the text to send
* @param user
* @param password
* @return
@@ -234,20 +234,19 @@ public interface JMSQueueControl extends DestinationControl {
@Parameter(name = "password") String password) throws Exception;
/**
- *
- * @param headers the message headers and properties to set. Can only
- * container Strings maped to primitive types.
- * @param body the text to send
- * @param user
- * @param password
- * @return
- * @throws Exception
- */
+ * @param headers the message headers and properties to set. Can only
+ * container Strings maped to primitive types.
+ * @param body the text to send
+ * @param user
+ * @param password
+ * @return
+ * @throws Exception
+ */
@Operation(desc = "Sends a TextMessage to a password-protected destination.", impact = MBeanOperationInfo.ACTION)
- String sendTextMessage(@Parameter(name = "headers") Map<String,String> headers,
- @Parameter(name = "body") String body,
- @Parameter(name = "user") String user,
- @Parameter(name = "password") String password) throws Exception;
+ String sendTextMessage(@Parameter(name = "headers") Map<String, String> headers,
+ @Parameter(name = "body") String body,
+ @Parameter(name = "user") String user,
+ @Parameter(name = "password") String password) throws Exception;
/**
* Changes the message's priority corresponding to the specified message ID to the specified priority.
@@ -382,7 +381,6 @@ public interface JMSQueueControl extends DestinationControl {
@Operation(desc = "Resume the queue.", impact = MBeanOperationInfo.ACTION)
void resume() throws Exception;
-
/**
* Resumes the queue. Messages are again delivered to its consumers.
*/
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSSessionInfo.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSSessionInfo.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSSessionInfo.java
index b5f0d08..f09c5cd 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSSessionInfo.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSSessionInfo.java
@@ -16,11 +16,11 @@
*/
package org.apache.activemq.artemis.api.jms.management;
-import org.apache.activemq.artemis.api.core.JsonUtil;
-
import javax.json.JsonArray;
import javax.json.JsonObject;
+import org.apache.activemq.artemis.api.core.JsonUtil;
+
public class JMSSessionInfo {
private final String sessionID;
@@ -38,8 +38,7 @@ public class JMSSessionInfo {
for (int i = 0; i < array.size(); i++) {
JsonObject obj = array.getJsonObject(i);
- JMSSessionInfo info = new JMSSessionInfo(obj.getString("sessionID"),
- obj.getJsonNumber("creationTime").longValue());
+ JMSSessionInfo info = new JMSSessionInfo(obj.getString("sessionID"), obj.getJsonNumber("creationTime").longValue());
infos[i] = info;
}
return infos;
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/SubscriptionInfo.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/SubscriptionInfo.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/SubscriptionInfo.java
index 1728d4f..eee2667 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/SubscriptionInfo.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/SubscriptionInfo.java
@@ -16,12 +16,11 @@
*/
package org.apache.activemq.artemis.api.jms.management;
-
-import org.apache.activemq.artemis.api.core.JsonUtil;
-
import javax.json.JsonArray;
import javax.json.JsonObject;
+import org.apache.activemq.artemis.api.core.JsonUtil;
+
/**
* Helper class to create Java Objects from the
* JSON serialization returned by {@link TopicControl#listAllSubscriptionsAsJSON()} and related methods.
@@ -53,9 +52,7 @@ public class SubscriptionInfo {
SubscriptionInfo[] infos = new SubscriptionInfo[array.size()];
for (int i = 0; i < array.size(); i++) {
JsonObject sub = array.getJsonObject(i);
- SubscriptionInfo info = new SubscriptionInfo(sub.getString("queueName"), sub.getString("clientID", null),
- sub.getString("name", null), sub.getBoolean("durable"), sub.getString("selector", null),
- sub.getInt("messageCount"), sub.getInt("deliveringCount"));
+ SubscriptionInfo info = new SubscriptionInfo(sub.getString("queueName"), sub.getString("clientID", null), sub.getString("name", null), sub.getBoolean("durable"), sub.getString("selector", null), sub.getInt("messageCount"), sub.getInt("deliveringCount"));
infos[i] = info;
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/TopicControl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/TopicControl.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/TopicControl.java
index d94e310..7e643f1 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/TopicControl.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/TopicControl.java
@@ -16,9 +16,8 @@
*/
package org.apache.activemq.artemis.api.jms.management;
-import java.util.Map;
-
import javax.management.MBeanOperationInfo;
+import java.util.Map;
import org.apache.activemq.artemis.api.core.management.Attribute;
import org.apache.activemq.artemis.api.core.management.Operation;
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQBytesMessage.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQBytesMessage.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQBytesMessage.java
index b585caf..59f04e8 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQBytesMessage.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQBytesMessage.java
@@ -104,8 +104,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadBoolean(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -115,8 +114,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadByte(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -126,8 +124,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadUnsignedByte(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -137,8 +134,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadShort(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -148,8 +144,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadUnsignedShort(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -159,8 +154,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadChar(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -170,8 +164,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadInt(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -181,8 +174,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadLong(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -192,8 +184,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadFloat(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -203,8 +194,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadDouble(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
}
}
@@ -214,11 +204,9 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkRead();
try {
return bytesReadUTF(message.getBodyBuffer());
- }
- catch (IndexOutOfBoundsException e) {
+ } catch (IndexOutOfBoundsException e) {
throw new MessageEOFException("");
- }
- catch (Exception e) {
+ } catch (Exception e) {
JMSException je = new JMSException("Failed to get UTF");
je.setLinkedException(e);
je.initCause(e);
@@ -292,8 +280,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
checkWrite();
try {
bytesWriteUTF(message.getBodyBuffer(), value);
- }
- catch (Exception e) {
+ } catch (Exception e) {
JMSException je = new JMSException("Failed to write UTF");
je.setLinkedException(e);
je.initCause(e);
@@ -346,8 +333,7 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag
try {
getBuffer().clear();
- }
- catch (RuntimeException e) {
+ } catch (RuntimeException e) {
JMSException e2 = new JMSException(e.getMessage());
e2.initCause(e);
throw e2;
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java
index fc9c59d..f896494 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java
@@ -237,8 +237,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
try {
initialSession.addUniqueMetaData(ClientSession.JMS_SESSION_CLIENT_ID_PROPERTY, clientID);
- }
- catch (ActiveMQException e) {
+ } catch (ActiveMQException e) {
if (e.getType() == ActiveMQExceptionType.DUPLICATE_METADATA) {
throw new InvalidClientIDException("clientID=" + clientID + " was already set into another connection");
}
@@ -247,8 +246,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
this.clientID = clientID;
try {
this.addSessionMetaData(initialSession);
- }
- catch (ActiveMQException e) {
+ } catch (ActiveMQException e) {
JMSException ex = new JMSException("Internal error setting metadata jms-client-id");
ex.setLinkedException(e);
ex.initCause(e);
@@ -349,15 +347,13 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
if (!initialSession.isClosed()) {
try {
initialSession.deleteQueue(queueName);
- }
- catch (ActiveMQException ignore) {
+ } catch (ActiveMQException ignore) {
// Exception on deleting queue shouldn't prevent close from completing
}
}
}
}
- }
- finally {
+ } finally {
if (initialSession != null) {
initialSession.close();
}
@@ -366,8 +362,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
failoverListenerExecutor.shutdown();
closed = true;
- }
- catch (ActiveMQException e) {
+ } catch (ActiveMQException e) {
throw JMSExceptionHelper.convertFromActiveMQException(e);
}
}
@@ -592,23 +587,17 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
if (acknowledgeMode == Session.SESSION_TRANSACTED) {
session = sessionFactory.createSession(username, password, isXA, false, false, sessionFactory.getServerLocator().isPreAcknowledge(), transactionBatchSize);
- }
- else if (acknowledgeMode == Session.AUTO_ACKNOWLEDGE) {
+ } else if (acknowledgeMode == Session.AUTO_ACKNOWLEDGE) {
session = sessionFactory.createSession(username, password, isXA, true, true, sessionFactory.getServerLocator().isPreAcknowledge(), 0);
- }
- else if (acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE) {
+ } else if (acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE) {
session = sessionFactory.createSession(username, password, isXA, true, true, sessionFactory.getServerLocator().isPreAcknowledge(), dupsOKBatchSize);
- }
- else if (acknowledgeMode == Session.CLIENT_ACKNOWLEDGE) {
+ } else if (acknowledgeMode == Session.CLIENT_ACKNOWLEDGE) {
session = sessionFactory.createSession(username, password, isXA, true, false, sessionFactory.getServerLocator().isPreAcknowledge(), transactionBatchSize);
- }
- else if (acknowledgeMode == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE) {
+ } else if (acknowledgeMode == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE) {
session = sessionFactory.createSession(username, password, isXA, true, false, false, transactionBatchSize);
- }
- else if (acknowledgeMode == ActiveMQJMSConstants.PRE_ACKNOWLEDGE) {
+ } else if (acknowledgeMode == ActiveMQJMSConstants.PRE_ACKNOWLEDGE) {
session = sessionFactory.createSession(username, password, isXA, true, false, true, transactionBatchSize);
- }
- else {
+ } else {
throw new JMSRuntimeException("Invalid ackmode: " + acknowledgeMode);
}
@@ -631,8 +620,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
this.addSessionMetaData(session);
return jbs;
- }
- catch (ActiveMQException e) {
+ } catch (ActiveMQException e) {
throw JMSExceptionHelper.convertFromActiveMQException(e);
}
}
@@ -657,8 +645,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
int type) {
if (isXA) {
return new ActiveMQXASession(options, this, transacted, true, acknowledgeMode, session, type);
- }
- else {
+ } else {
return new ActiveMQSession(options, this, transacted, false, acknowledgeMode, session, type);
}
}
@@ -677,8 +664,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
initialSession.addFailureListener(listener);
initialSession.addFailoverListener(failoverListener);
- }
- catch (ActiveMQException me) {
+ } catch (ActiveMQException me) {
throw JMSExceptionHelper.convertFromActiveMQException(me);
}
}
@@ -740,8 +726,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
}
}).start();
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
if (!conn.closed) {
ActiveMQJMSClientLogger.LOGGER.errorCallingExcListener(e);
}
@@ -786,8 +771,7 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme
}
});
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
if (!conn.closed) {
ActiveMQJMSClientLogger.LOGGER.errorCallingFailoverListener(e);
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java
index ce531f5..3a16cbd 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java
@@ -89,8 +89,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
try {
out.writeUTF(uri.toASCIIString());
- }
- catch (Exception e) {
+ } catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
@@ -104,16 +103,13 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
if (serverLocator.getDiscoveryGroupConfiguration() != null) {
if (serverLocator.getDiscoveryGroupConfiguration().getBroadcastEndpointFactory() instanceof UDPBroadcastEndpointFactory) {
scheme = "udp";
- }
- else {
+ } else {
scheme = "jgroups";
}
- }
- else {
+ } else {
if (serverLocator.allInVM()) {
scheme = "vm";
- }
- else {
+ } else {
scheme = "tcp";
}
}
@@ -122,8 +118,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
try {
uri = parser.createSchema(scheme, this);
- }
- catch (Exception e) {
+ } catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
@@ -139,12 +134,11 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
public void setProtocolManagerFactoryStr(final String protocolManagerFactoryStr) {
if (protocolManagerFactoryStr != null && !protocolManagerFactoryStr.trim().isEmpty() &&
- !protocolManagerFactoryStr.equals("undefined")) {
+ !protocolManagerFactoryStr.equals("undefined")) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
- ClientProtocolManagerFactory protocolManagerFactory =
- (ClientProtocolManagerFactory) ClassloadingUtil.newInstanceFromClassLoader(protocolManagerFactoryStr);
+ ClientProtocolManagerFactory protocolManagerFactory = (ClientProtocolManagerFactory) ClassloadingUtil.newInstanceFromClassLoader(protocolManagerFactoryStr);
serverLocator.setProtocolManagerFactory(protocolManagerFactory);
return null;
}
@@ -183,8 +177,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
URI uri = new URI(url);
serverLocator = locatorParser.newObject(uri, null);
parser.populateObject(uri, this);
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw new InvalidObjectException(e.getMessage());
}
}
@@ -202,8 +195,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
URI uri = new URI(url);
serverLocator = ServerLocatorImpl.newLocator(uri);
cfParser.populateObject(uri, this);
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
@@ -233,8 +225,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
public ActiveMQConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration) {
if (ha) {
serverLocator = ActiveMQClient.createServerLocatorWithHA(groupConfiguration);
- }
- else {
+ } else {
serverLocator = ActiveMQClient.createServerLocatorWithoutHA(groupConfiguration);
}
@@ -244,8 +235,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
public ActiveMQConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors) {
if (ha) {
serverLocator = ActiveMQClient.createServerLocatorWithHA(initialConnectors);
- }
- else {
+ } else {
serverLocator = ActiveMQClient.createServerLocatorWithoutHA(initialConnectors);
}
@@ -283,11 +273,9 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
try {
ActiveMQConnection connection = createConnectionInternal(userName, password, false, ActiveMQConnection.TYPE_GENERIC_CONNECTION);
return connection.createContext(sessionMode);
- }
- catch (JMSSecurityException e) {
+ } catch (JMSSecurityException e) {
throw new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -345,11 +333,9 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
try {
ActiveMQConnection connection = createConnectionInternal(userName, password, true, ActiveMQConnection.TYPE_GENERIC_CONNECTION);
return connection.createXAContext();
- }
- catch (JMSSecurityException e) {
+ } catch (JMSSecurityException e) {
throw new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -754,8 +740,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
try {
factory = serverLocator.createSessionFactory();
- }
- catch (Exception e) {
+ } catch (Exception e) {
JMSException jmse = new JMSException("Failed to create session factory");
jmse.initCause(e);
@@ -769,22 +754,17 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
if (isXA) {
if (type == ActiveMQConnection.TYPE_GENERIC_CONNECTION) {
connection = new ActiveMQXAConnection(this, username, password, type, clientID, dupsOKBatchSize, transactionBatchSize, factory);
- }
- else if (type == ActiveMQConnection.TYPE_QUEUE_CONNECTION) {
+ } else if (type == ActiveMQConnection.TYPE_QUEUE_CONNECTION) {
connection = new ActiveMQXAConnection(this, username, password, type, clientID, dupsOKBatchSize, transactionBatchSize, factory);
- }
- else if (type == ActiveMQConnection.TYPE_TOPIC_CONNECTION) {
+ } else if (type == ActiveMQConnection.TYPE_TOPIC_CONNECTION) {
connection = new ActiveMQXAConnection(this, username, password, type, clientID, dupsOKBatchSize, transactionBatchSize, factory);
}
- }
- else {
+ } else {
if (type == ActiveMQConnection.TYPE_GENERIC_CONNECTION) {
connection = new ActiveMQConnection(this, username, password, type, clientID, dupsOKBatchSize, transactionBatchSize, factory);
- }
- else if (type == ActiveMQConnection.TYPE_QUEUE_CONNECTION) {
+ } else if (type == ActiveMQConnection.TYPE_QUEUE_CONNECTION) {
connection = new ActiveMQConnection(this, username, password, type, clientID, dupsOKBatchSize, transactionBatchSize, factory);
- }
- else if (type == ActiveMQConnection.TYPE_TOPIC_CONNECTION) {
+ } else if (type == ActiveMQConnection.TYPE_TOPIC_CONNECTION) {
connection = new ActiveMQConnection(this, username, password, type, clientID, dupsOKBatchSize, transactionBatchSize, factory);
}
}
@@ -796,12 +776,10 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
try {
connection.authorize();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
try {
connection.close();
- }
- catch (JMSException me) {
+ } catch (JMSException me) {
}
throw e;
}
@@ -837,8 +815,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactoryOptions, Exte
protected void finalize() throws Throwable {
try {
serverLocator.close();
- }
- catch (Exception e) {
+ } catch (Exception e) {
e.printStackTrace();
//not much we can do here
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionForContextImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionForContextImpl.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionForContextImpl.java
index b1c44a3..3ca26be 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionForContextImpl.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionForContextImpl.java
@@ -33,8 +33,7 @@ public abstract class ActiveMQConnectionForContextImpl implements ActiveMQConnec
public void run() {
try {
close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionMetaData.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionMetaData.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionMetaData.java
index 8a14915..c72c4d4 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionMetaData.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionMetaData.java
@@ -16,11 +16,10 @@
*/
package org.apache.activemq.artemis.jms.client;
-import java.util.Enumeration;
-import java.util.Vector;
-
import javax.jms.ConnectionMetaData;
import javax.jms.JMSException;
+import java.util.Enumeration;
+import java.util.Vector;
import org.apache.activemq.artemis.core.version.Version;
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java
index 6d4a40b..4aed49f 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java
@@ -76,14 +76,11 @@ public class ActiveMQDestination implements Destination, Serializable, Reference
public static ActiveMQDestination createDestination(String name, byte defaultType) {
if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) {
return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length()));
- }
- else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) {
+ } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) {
return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length()));
- }
- else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) {
+ } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) {
return new ActiveMQQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length()), true);
- }
- else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) {
+ } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) {
return new ActiveMQTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length()), true);
}
@@ -106,23 +103,19 @@ public class ActiveMQDestination implements Destination, Serializable, Reference
String name = address.substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length());
return createQueue(name);
- }
- else if (address.startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX)) {
+ } else if (address.startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX)) {
String name = address.substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length());
return createTopic(name);
- }
- else if (address.startsWith(ActiveMQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX)) {
+ } else if (address.startsWith(ActiveMQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX)) {
String name = address.substring(ActiveMQDestination.JMS_TEMP_QUEUE_ADDRESS_PREFIX.length());
return new ActiveMQTemporaryQueue(address, name, null);
- }
- else if (address.startsWith(ActiveMQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX)) {
+ } else if (address.startsWith(ActiveMQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX)) {
String name = address.substring(ActiveMQDestination.JMS_TEMP_TOPIC_ADDRESS_PREFIX.length());
return new ActiveMQTemporaryTopic(address, name, null);
- }
- else {
+ } else {
throw new JMSRuntimeException("Invalid address " + address);
}
}
@@ -134,18 +127,15 @@ public class ActiveMQDestination implements Destination, Serializable, Reference
if (isDurable) {
return ActiveMQDestination.escape(clientID) + SEPARATOR +
ActiveMQDestination.escape(subscriptionName);
- }
- else {
+ } else {
return "nonDurable" + SEPARATOR +
ActiveMQDestination.escape(clientID) + SEPARATOR +
ActiveMQDestination.escape(subscriptionName);
}
- }
- else {
+ } else {
if (isDurable) {
return ActiveMQDestination.escape(subscriptionName);
- }
- else {
+ } else {
return "nonDurable" + SEPARATOR +
ActiveMQDestination.escape(subscriptionName);
}
@@ -159,8 +149,7 @@ public class ActiveMQDestination implements Destination, Serializable, Reference
return (isDurable ? "Durable" : "nonDurable") + SEPARATOR +
ActiveMQDestination.escape(clientID) + SEPARATOR +
ActiveMQDestination.escape(subscriptionName);
- }
- else {
+ } else {
return (isDurable ? "Durable" : "nonDurable") + SEPARATOR +
ActiveMQDestination.escape(subscriptionName);
}
@@ -314,8 +303,7 @@ public class ActiveMQDestination implements Destination, Serializable, Reference
}
if (queue) {
session.deleteTemporaryQueue(this);
- }
- else {
+ } else {
session.deleteTemporaryTopic(this);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSClientBundle.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSClientBundle.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSClientBundle.java
index f971117..844446c 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSClientBundle.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSClientBundle.java
@@ -28,10 +28,10 @@ import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException;
import org.apache.activemq.artemis.api.core.ActiveMQInvalidFilterExpressionException;
import org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException;
import org.apache.activemq.artemis.api.core.SimpleString;
+import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
-import org.jboss.logging.Messages;
/**
* Logger Code 12
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSConsumer.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSConsumer.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSConsumer.java
index c59812b..e359f5b 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSConsumer.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSConsumer.java
@@ -37,8 +37,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
public String getMessageSelector() {
try {
return consumer.getMessageSelector();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -47,8 +46,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
public MessageListener getMessageListener() throws JMSRuntimeException {
try {
return consumer.getMessageListener();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -57,8 +55,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
public void setMessageListener(MessageListener listener) throws JMSRuntimeException {
try {
consumer.setMessageListener(new MessageListenerWrapper(listener));
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -67,8 +64,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
public Message receive() {
try {
return context.setLastMessage(this, consumer.receive());
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -77,8 +73,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
public Message receive(long timeout) {
try {
return context.setLastMessage(this, consumer.receive(timeout));
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -87,8 +82,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
public Message receiveNoWait() {
try {
return context.setLastMessage(this, consumer.receiveNoWait());
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -97,8 +91,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
public void close() {
try {
consumer.close();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -109,8 +102,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
Message message = consumer.receive();
context.setLastMessage(ActiveMQJMSConsumer.this, message);
return message == null ? null : message.getBody(c);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -121,8 +113,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
Message message = consumer.receive(timeout);
context.setLastMessage(ActiveMQJMSConsumer.this, message);
return message == null ? null : message.getBody(c);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -133,8 +124,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
Message message = consumer.receiveNoWait();
context.setLastMessage(ActiveMQJMSConsumer.this, message);
return message == null ? null : message.getBody(c);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -154,8 +144,7 @@ public class ActiveMQJMSConsumer implements JMSConsumer {
context.getThreadAwareContext().setCurrentThread(false);
try {
wrapped.onMessage(message);
- }
- finally {
+ } finally {
context.getThreadAwareContext().clearCurrentThread(false);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java
index 3065f27..7a6c9ef 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java
@@ -111,8 +111,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return new ActiveMQJMSProducer(this, getInnerProducer());
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -137,12 +136,10 @@ public class ActiveMQJMSContext implements JMSContext {
try {
if (xa) {
session = ((XAConnection) connection).createXASession();
- }
- else {
+ } else {
session = connection.createSession(sessionMode);
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -154,8 +151,7 @@ public class ActiveMQJMSContext implements JMSContext {
public String getClientID() {
try {
return connection.getClientID();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -164,8 +160,7 @@ public class ActiveMQJMSContext implements JMSContext {
public void setClientID(String clientID) {
try {
connection.setClientID(clientID);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -174,8 +169,7 @@ public class ActiveMQJMSContext implements JMSContext {
public ConnectionMetaData getMetaData() {
try {
return connection.getMetaData();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -184,8 +178,7 @@ public class ActiveMQJMSContext implements JMSContext {
public ExceptionListener getExceptionListener() {
try {
return connection.getExceptionListener();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -194,8 +187,7 @@ public class ActiveMQJMSContext implements JMSContext {
public void setExceptionListener(ExceptionListener listener) {
try {
connection.setExceptionListener(listener);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -204,8 +196,7 @@ public class ActiveMQJMSContext implements JMSContext {
public void start() {
try {
connection.start();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -215,8 +206,7 @@ public class ActiveMQJMSContext implements JMSContext {
threadAwareContext.assertNotMessageListenerThreadRuntime();
try {
connection.stop();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -242,8 +232,7 @@ public class ActiveMQJMSContext implements JMSContext {
connection.closeFromContext();
closed = true;
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -253,8 +242,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createBytesMessage();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -264,8 +252,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createMapMessage();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -275,8 +262,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createMessage();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -286,8 +272,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createObjectMessage();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -297,8 +282,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createObjectMessage(object);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -308,8 +292,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createStreamMessage();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -319,8 +302,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createTextMessage();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -330,8 +312,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createTextMessage(text);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -341,8 +322,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.getTransacted();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -358,8 +338,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
session.commit();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -370,8 +349,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
session.rollback();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -381,8 +359,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
session.recover();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -394,8 +371,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createConsumer(destination));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -407,8 +383,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createConsumer(destination, messageSelector));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -420,8 +395,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createConsumer(destination, messageSelector, noLocal));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -431,8 +405,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createQueue(queueName);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -442,8 +415,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createTopic(topicName);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -455,8 +427,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createDurableConsumer(topic, name));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -468,8 +439,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createDurableConsumer(topic, name, messageSelector, noLocal));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -481,8 +451,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedDurableConsumer(topic, name));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -494,8 +463,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedDurableConsumer(topic, name, messageSelector));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -507,8 +475,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedConsumer(topic, sharedSubscriptionName));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -520,8 +487,7 @@ public class ActiveMQJMSContext implements JMSContext {
ActiveMQJMSConsumer consumer = new ActiveMQJMSConsumer(this, session.createSharedConsumer(topic, sharedSubscriptionName, messageSelector));
checkAutoStart();
return consumer;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -533,8 +499,7 @@ public class ActiveMQJMSContext implements JMSContext {
QueueBrowser browser = session.createBrowser(queue);
checkAutoStart();
return browser;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -546,8 +511,7 @@ public class ActiveMQJMSContext implements JMSContext {
QueueBrowser browser = session.createBrowser(queue, messageSelector);
checkAutoStart();
return browser;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -557,8 +521,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createTemporaryQueue();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -568,8 +531,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
return session.createTemporaryTopic();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -579,8 +541,7 @@ public class ActiveMQJMSContext implements JMSContext {
checkSession();
try {
session.unsubscribe(name);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -594,8 +555,7 @@ public class ActiveMQJMSContext implements JMSContext {
if (lastMessagesWaitingAck != null) {
lastMessagesWaitingAck.acknowledge();
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java
----------------------------------------------------------------------
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java
index 17d6c3c..9911302 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java
@@ -94,12 +94,10 @@ public final class ActiveMQJMSProducer implements JMSProducer {
if (completionListener != null) {
CompletionListener wrapped = new CompletionListenerWrapper(completionListener);
producer.send(destination, message, wrapped);
- }
- else {
+ } else {
producer.send(destination, message);
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
return this;
@@ -134,41 +132,30 @@ public final class ActiveMQJMSProducer implements JMSProducer {
final Object v = entry.getValue();
if (v instanceof String) {
message.setString(name, (String) v);
- }
- else if (v instanceof Long) {
+ } else if (v instanceof Long) {
message.setLong(name, (Long) v);
- }
- else if (v instanceof Double) {
+ } else if (v instanceof Double) {
message.setDouble(name, (Double) v);
- }
- else if (v instanceof Integer) {
+ } else if (v instanceof Integer) {
message.setInt(name, (Integer) v);
- }
- else if (v instanceof Character) {
+ } else if (v instanceof Character) {
message.setChar(name, (Character) v);
- }
- else if (v instanceof Short) {
+ } else if (v instanceof Short) {
message.setShort(name, (Short) v);
- }
- else if (v instanceof Boolean) {
+ } else if (v instanceof Boolean) {
message.setBoolean(name, (Boolean) v);
- }
- else if (v instanceof Float) {
+ } else if (v instanceof Float) {
message.setFloat(name, (Float) v);
- }
- else if (v instanceof Byte) {
+ } else if (v instanceof Byte) {
message.setByte(name, (Byte) v);
- }
- else if (v instanceof byte[]) {
+ } else if (v instanceof byte[]) {
byte[] array = (byte[]) v;
message.setBytes(name, array, 0, array.length);
- }
- else {
+ } else {
message.setObject(name, v);
}
}
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw new MessageFormatRuntimeException(e.getMessage());
}
}
@@ -182,8 +169,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
if (body != null) {
try {
message.writeBytes(body);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw new MessageFormatRuntimeException(e.getMessage());
}
}
@@ -202,8 +188,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public JMSProducer setDisableMessageID(boolean value) {
try {
producer.setDisableMessageID(value);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
return this;
@@ -213,8 +198,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public boolean getDisableMessageID() {
try {
return producer.getDisableMessageID();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -223,8 +207,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public JMSProducer setDisableMessageTimestamp(boolean value) {
try {
producer.setDisableMessageTimestamp(value);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
return this;
@@ -234,8 +217,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public boolean getDisableMessageTimestamp() {
try {
return producer.getDisableMessageTimestamp();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
throw JmsExceptionUtils.convertToRuntimeException(e);
}
}
@@ -244,8 +226,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public JMSProducer setDeliveryMode(int deliveryMode) {
try {
producer.setDeliveryMode(deliveryMode);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
e2.initCause(e);
throw e2;
@@ -257,8 +238,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public int getDeliveryMode() {
try {
return producer.getDeliveryMode();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
e2.initCause(e);
throw e2;
@@ -269,8 +249,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public JMSProducer setPriority(int priority) {
try {
producer.setPriority(priority);
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
e2.initCause(e);
throw e2;
@@ -282,8 +261,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public int getPriority() {
try {
return producer.getPriority();
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
e2.initCause(e);
throw e2;
@@ -295,8 +273,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
try {
producer.setTimeToLive(timeToLive);
return this;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
e2.initCause(e);
throw e2;
@@ -309,8 +286,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
try {
timeToLive = producer.getTimeToLive();
return timeToLive;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
e2.initCause(e);
throw e2;
@@ -322,8 +298,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
try {
producer.setDeliveryDelay(deliveryDelay);
return this;
- }
- catch (JMSException e) {
+ } catch (JMSException e) {
JMSRuntimeException e2 = new JMSRuntimeException(e.getMessage());
e2.initCause(e);
throw e2;
@@ -335,8 +310,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
long deliveryDelay = 0;
try {
deliveryDelay = producer.getDeliveryDelay();
- }
- catch (Exception ignored) {
+ } catch (Exception ignored) {
}
return deliveryDelay;
}
@@ -415,11 +389,9 @@ public final class ActiveMQJMSProducer implements JMSProducer {
checkName(name);
try {
TypedProperties.setObjectProperty(new SimpleString(name), value, properties);
- }
- catch (ActiveMQPropertyConversionException amqe) {
+ } catch (ActiveMQPropertyConversionException amqe) {
throw new MessageFormatRuntimeException(amqe.getMessage());
- }
- catch (RuntimeException e) {
+ } catch (RuntimeException e) {
throw new JMSRuntimeException(e.getMessage());
}
return this;
@@ -430,8 +402,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
try {
stringPropertyNames.clear();
properties.clear();
- }
- catch (RuntimeException e) {
+ } catch (RuntimeException e) {
throw new JMSRuntimeException(e.getMessage());
}
return this;
@@ -446,11 +417,9 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public boolean getBooleanProperty(String name) {
try {
return properties.getBooleanProperty(new SimpleString(name));
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
- }
- catch (RuntimeException e) {
+ } catch (RuntimeException e) {
throw new JMSRuntimeException(e.getMessage());
}
}
@@ -459,8 +428,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public byte getByteProperty(String name) {
try {
return properties.getByteProperty(new SimpleString(name));
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
}
}
@@ -469,8 +437,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public short getShortProperty(String name) {
try {
return properties.getShortProperty(new SimpleString(name));
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
}
}
@@ -479,8 +446,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public int getIntProperty(String name) {
try {
return properties.getIntProperty(new SimpleString(name));
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
}
}
@@ -489,8 +455,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public long getLongProperty(String name) {
try {
return properties.getLongProperty(new SimpleString(name));
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
}
}
@@ -499,8 +464,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public float getFloatProperty(String name) {
try {
return properties.getFloatProperty(new SimpleString(name));
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
}
}
@@ -509,8 +473,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
public double getDoubleProperty(String name) {
try {
return properties.getDoubleProperty(new SimpleString(name));
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
}
}
@@ -522,11 +485,9 @@ public final class ActiveMQJMSProducer implements JMSProducer {
if (prop == null)
return null;
return prop.toString();
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
- }
- catch (RuntimeException e) {
+ } catch (RuntimeException e) {
throw new JMSRuntimeException(e.getMessage());
}
}
@@ -540,11 +501,9 @@ public final class ActiveMQJMSProducer implements JMSProducer {
property = property.toString();
}
return property;
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
- }
- catch (RuntimeException e) {
+ } catch (RuntimeException e) {
throw new JMSRuntimeException(e.getMessage());
}
}
@@ -559,11 +518,9 @@ public final class ActiveMQJMSProducer implements JMSProducer {
propNames.add(str.toString());
}
return propNames;
- }
- catch (ActiveMQPropertyConversionException ce) {
+ } catch (ActiveMQPropertyConversionException ce) {
throw new MessageFormatRuntimeException(ce.getMessage());
- }
- catch (RuntimeException e) {
+ } catch (RuntimeException e) {
throw new JMSRuntimeException(e.getMessage());
}
}
@@ -637,8 +594,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
context.getThreadAwareContext().setCurrentThread(true);
try {
wrapped.onCompletion(message);
- }
- finally {
+ } finally {
context.getThreadAwareContext().clearCurrentThread(true);
}
}
@@ -648,8 +604,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
context.getThreadAwareContext().setCurrentThread(true);
try {
wrapped.onException(message, exception);
- }
- finally {
+ } finally {
context.getThreadAwareContext().clearCurrentThread(true);
}
}