From 2256ec03b40e2604a3067522bbdbc41c542c86e7 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Mon, 25 Jun 2007 12:40:25 +0000 Subject: [PATCH] apply patch http://issues.apache.org/activemq/browse/AMQ-1293 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@550472 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/ra/ActiveMQActivationSpec.java | 10 +++++----- .../ra/ActiveMQConnectionRequestInfo.java | 18 +++++++++--------- .../ra/ActiveMQEndpointActivationKey.java | 2 +- .../java/org/apache/activemq/ra/MDBTest.java | 2 +- .../activemq/ra/MessageEndpointProxyTest.java | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java index 1694c1a721..1eeab40dd4 100644 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQActivationSpec.java @@ -533,7 +533,7 @@ public String toString() { } public String getMaxMessagesPerSessions() { - return maxMessagesPerSessions.toString(); + return maxMessagesPerSessions; } /** @@ -592,14 +592,14 @@ public String toString() { } public boolean isUseRAManagedTransactionEnabled() { - return new Boolean(useRAManagedTransaction).booleanValue(); + return Boolean.valueOf(useRAManagedTransaction).booleanValue(); } /** * */ public boolean getNoLocalBooleanValue() { - return new Boolean(noLocal).booleanValue(); + return Boolean.valueOf(noLocal).booleanValue(); } public String getEnableBatch() { @@ -616,7 +616,7 @@ public String toString() { } public boolean getEnableBatchBooleanValue() { - return new Boolean(enableBatch).booleanValue(); + return Boolean.valueOf(enableBatch).booleanValue(); } public int getMaxMessagesPerBatchIntValue() { @@ -624,7 +624,7 @@ public String toString() { } public String getMaxMessagesPerBatch() { - return maxMessagesPerBatch.toString(); + return maxMessagesPerBatch; } /** diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java index 97f2056bbd..017930423f 100755 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java @@ -199,19 +199,19 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser } public Short getRedeliveryBackOffMultiplier() { - return new Short(redeliveryPolicy().getBackOffMultiplier()); + return Short.valueOf(redeliveryPolicy().getBackOffMultiplier()); } public Long getInitialRedeliveryDelay() { - return new Long(redeliveryPolicy().getInitialRedeliveryDelay()); + return Long.valueOf(redeliveryPolicy().getInitialRedeliveryDelay()); } public Integer getMaximumRedeliveries() { - return new Integer(redeliveryPolicy().getMaximumRedeliveries()); + return Integer.valueOf(redeliveryPolicy().getMaximumRedeliveries()); } public Boolean getRedeliveryUseExponentialBackOff() { - return new Boolean(redeliveryPolicy().isUseExponentialBackOff()); + return Boolean.valueOf(redeliveryPolicy().isUseExponentialBackOff()); } public void setRedeliveryBackOffMultiplier(Short value) { @@ -239,23 +239,23 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser } public Integer getDurableTopicPrefetch() { - return new Integer(prefetchPolicy().getDurableTopicPrefetch()); + return Integer.valueOf(prefetchPolicy().getDurableTopicPrefetch()); } public Integer getInputStreamPrefetch() { - return new Integer(prefetchPolicy().getInputStreamPrefetch()); + return Integer.valueOf(prefetchPolicy().getInputStreamPrefetch()); } public Integer getQueueBrowserPrefetch() { - return new Integer(prefetchPolicy().getQueueBrowserPrefetch()); + return Integer.valueOf(prefetchPolicy().getQueueBrowserPrefetch()); } public Integer getQueuePrefetch() { - return new Integer(prefetchPolicy().getQueuePrefetch()); + return Integer.valueOf(prefetchPolicy().getQueuePrefetch()); } public Integer getTopicPrefetch() { - return new Integer(prefetchPolicy().getTopicPrefetch()); + return Integer.valueOf(prefetchPolicy().getTopicPrefetch()); } public void setAllPrefetchValues(Integer i) { diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointActivationKey.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointActivationKey.java index 647be67816..24cda6e5ac 100755 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointActivationKey.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointActivationKey.java @@ -68,7 +68,7 @@ public class ActiveMQEndpointActivationKey { if (this == obj) { return true; } - if (obj == null) { + if (obj == null || !(obj instanceof ActiveMQEndpointActivationKey)) { return false; } ActiveMQEndpointActivationKey o = (ActiveMQEndpointActivationKey) obj; diff --git a/activemq-ra/src/test/java/org/apache/activemq/ra/MDBTest.java b/activemq-ra/src/test/java/org/apache/activemq/ra/MDBTest.java index 817cda92f2..7db46a599b 100644 --- a/activemq-ra/src/test/java/org/apache/activemq/ra/MDBTest.java +++ b/activemq-ra/src/test/java/org/apache/activemq/ra/MDBTest.java @@ -55,7 +55,7 @@ import java.util.concurrent.TimeUnit; public class MDBTest extends TestCase { - private final class StubBootstrapContext implements BootstrapContext { + private static final class StubBootstrapContext implements BootstrapContext { public WorkManager getWorkManager() { return new WorkManager() { public void doWork(Work work) throws WorkException { diff --git a/activemq-ra/src/test/java/org/apache/activemq/ra/MessageEndpointProxyTest.java b/activemq-ra/src/test/java/org/apache/activemq/ra/MessageEndpointProxyTest.java index 58826641eb..442c2cf599 100755 --- a/activemq-ra/src/test/java/org/apache/activemq/ra/MessageEndpointProxyTest.java +++ b/activemq-ra/src/test/java/org/apache/activemq/ra/MessageEndpointProxyTest.java @@ -51,7 +51,7 @@ public class MessageEndpointProxyTest extends MockObjectTestCase { public void testInvalidConstruction() { Mock mockEndpoint = new Mock(MessageEndpoint.class); try { - MessageEndpointProxy proxy = new MessageEndpointProxy((MessageEndpoint) mockEndpoint.proxy()); + new MessageEndpointProxy((MessageEndpoint) mockEndpoint.proxy()); fail("An exception should have been thrown"); } catch (IllegalArgumentException e) { assertTrue(true);