diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java index 9b74da1c00..5016a760fd 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/InboundTransformer.java @@ -90,7 +90,7 @@ public abstract class InboundTransformer { jms.setBooleanProperty(JMS_AMQP_HEADER, true); if (header.getDurable() != null) { - jms.setPersistent(header.getDurable().booleanValue()); + jms.setPersistent(header.getDurable()); } else { jms.setPersistent(false); } diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java index 2dadb30c84..b28b270ea6 100644 --- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java +++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java @@ -636,7 +636,7 @@ public class AmqpConnection implements AmqpProtocolConverter { public void onActiveMQCommand(Command command) throws Exception { if (command.isResponse()) { Response response = (Response) command; - ResponseHandler rh = resposeHandlers.remove(Integer.valueOf(response.getCorrelationId())); + ResponseHandler rh = resposeHandlers.remove(response.getCorrelationId()); if (rh != null) { rh.onResponse(this, response); } else { @@ -799,7 +799,7 @@ public class AmqpConnection implements AmqpProtocolConverter { command.setCommandId(lastCommandId.incrementAndGet()); if (handler != null) { command.setResponseRequired(true); - resposeHandlers.put(Integer.valueOf(command.getCommandId()), handler); + resposeHandlers.put(command.getCommandId(), handler); } amqpTransport.sendToActiveMQ(command); } diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java index a91b685c63..0565f41841 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSInteroperabilityTest.java @@ -124,7 +124,7 @@ public class JMSInteroperabilityTest extends JMSClientTestSupport { outbound.setDoubleProperty("Double", nDouble); outbound.setStringProperty("String", "test"); outbound.setLongProperty("Long", nLong); - outbound.setObjectProperty("BooleanObject", Boolean.valueOf(bool)); + outbound.setObjectProperty("BooleanObject", bool); openwireProducer.send(outbound); @@ -208,7 +208,7 @@ public class JMSInteroperabilityTest extends JMSClientTestSupport { outbound.setDoubleProperty("Double", nDouble); outbound.setStringProperty("String", "test"); outbound.setLongProperty("Long", nLong); - outbound.setObjectProperty("BooleanObject", Boolean.valueOf(bool)); + outbound.setObjectProperty("BooleanObject", bool); amqpProducer.send(outbound); diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSMessageGroupsTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSMessageGroupsTest.java index 8b1e786016..64d71441f3 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSMessageGroupsTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSMessageGroupsTest.java @@ -82,8 +82,7 @@ public class JMSMessageGroupsTest extends JMSClientTestSupport { byte[] buffer = new byte[MESSAGE_SIZE]; for (count = 0; count < MESSAGE_SIZE; count++) { String s = String.valueOf(count % 10); - Character c = s.charAt(0); - int value = c.charValue(); + int value = s.charAt(0); buffer[count] = (byte) value; } diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/util/TypeConversionSupport.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/util/TypeConversionSupport.java index 914f68c49d..b9dde6f693 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/util/TypeConversionSupport.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/util/TypeConversionSupport.java @@ -119,7 +119,7 @@ public final class TypeConversionSupport { Converter longConverter = new Converter() { @Override public Object convert(Object value) { - return Long.valueOf(((Number) value).longValue()); + return ((Number) value).longValue(); } }; CONVERSION_MAP.put(new ConversionKey(Byte.class, Long.class), longConverter); @@ -128,14 +128,14 @@ public final class TypeConversionSupport { CONVERSION_MAP.put(new ConversionKey(Date.class, Long.class), new Converter() { @Override public Object convert(Object value) { - return Long.valueOf(((Date) value).getTime()); + return ((Date) value).getTime(); } }); Converter intConverter = new Converter() { @Override public Object convert(Object value) { - return Integer.valueOf(((Number) value).intValue()); + return ((Number) value).intValue(); } }; CONVERSION_MAP.put(new ConversionKey(Byte.class, Integer.class), intConverter); @@ -144,14 +144,14 @@ public final class TypeConversionSupport { CONVERSION_MAP.put(new ConversionKey(Byte.class, Short.class), new Converter() { @Override public Object convert(Object value) { - return Short.valueOf(((Number) value).shortValue()); + return ((Number) value).shortValue(); } }); CONVERSION_MAP.put(new ConversionKey(Float.class, Double.class), new Converter() { @Override public Object convert(Object value) { - return Double.valueOf(((Number) value).doubleValue()); + return ((Number) value).doubleValue(); } }); } diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/AMQPMessageIdHelperTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/AMQPMessageIdHelperTest.java index d3e29bc3e3..bbc4a4a86d 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/AMQPMessageIdHelperTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/message/AMQPMessageIdHelperTest.java @@ -104,7 +104,7 @@ public class AMQPMessageIdHelperTest { */ @Test public void testToBaseMessageIdStringWithStringBeginningWithEncodingPrefixForLong() { - String longStringMessageId = AMQPMessageIdHelper.AMQP_ULONG_PREFIX + Long.valueOf(123456789L); + String longStringMessageId = AMQPMessageIdHelper.AMQP_ULONG_PREFIX + 123456789L; String expected = AMQPMessageIdHelper.AMQP_STRING_PREFIX + longStringMessageId; String baseMessageIdString = messageIdHelper.toBaseMessageIdString(longStringMessageId); diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerFactory.java b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerFactory.java index cfc4bbe4be..9dfb85952e 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerFactory.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerFactory.java @@ -112,6 +112,6 @@ public final class BrokerFactory { if( value==null ) { return true; } - return value.booleanValue(); + return value; } } diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java b/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java index 7a745b5ac3..e4f4d81774 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java @@ -160,7 +160,7 @@ public class TransactionBroker extends BrokerFilter { @Override public int hashCode() { return System.identityHashCode(destination) + - System.identityHashCode(Boolean.valueOf(messageSend)); + System.identityHashCode(messageSend); } @Override diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java index b72bf17ffe..9484f757c1 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/OpenTypeSupport.java @@ -165,9 +165,9 @@ public final class OpenTypeSupport { rc.put("JMSReplyTo",toString(m.getJMSReplyTo())); rc.put("JMSType", m.getJMSType()); rc.put("JMSDeliveryMode", m.getJMSDeliveryMode() == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON-PERSISTENT"); - rc.put("JMSExpiration", Long.valueOf(m.getJMSExpiration())); - rc.put("JMSPriority", Integer.valueOf(m.getJMSPriority())); - rc.put("JMSRedelivered", Boolean.valueOf(m.getJMSRedelivered())); + rc.put("JMSExpiration", m.getJMSExpiration()); + rc.put("JMSPriority", m.getJMSPriority()); + rc.put("JMSRedelivered", m.getJMSRedelivered()); rc.put("JMSTimestamp", new Date(m.getJMSTimestamp())); rc.put(CompositeDataConstants.JMSXGROUP_ID, m.getGroupID()); rc.put(CompositeDataConstants.JMSXGROUP_SEQ, m.getGroupSequence()); @@ -288,9 +288,9 @@ public final class OpenTypeSupport { long length = 0; try { length = m.getBodyLength(); - rc.put(CompositeDataConstants.BODY_LENGTH, Long.valueOf(length)); + rc.put(CompositeDataConstants.BODY_LENGTH, length); } catch (JMSException e) { - rc.put(CompositeDataConstants.BODY_LENGTH, Long.valueOf(0)); + rc.put(CompositeDataConstants.BODY_LENGTH, 0L); } try { byte preview[] = new byte[(int)Math.min(length, 255)]; @@ -302,7 +302,7 @@ public final class OpenTypeSupport { // In 1.6 it seems it is supported.. but until then... Byte data[] = new Byte[preview.length]; for (int i = 0; i < data.length; i++) { - data[i] = Byte.valueOf(preview[i]); + data[i] = preview[i]; } rc.put(CompositeDataConstants.BODY_PREVIEW, data); @@ -482,8 +482,8 @@ public final class OpenTypeSupport { SlowConsumerEntry entry = (SlowConsumerEntry) o; Map rc = super.getFields(o); rc.put("subscription", entry.getSubscription()); - rc.put("slowCount", Integer.valueOf(entry.getSlowCount())); - rc.put("markCount", Integer.valueOf(entry.getMarkCount())); + rc.put("slowCount", entry.getSlowCount()); + rc.put("markCount", entry.getMarkCount()); return rc; } } diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java index e58da626a9..705f7a0451 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/DurableTopicSubscription.java @@ -227,9 +227,9 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us (lastDeliveredSequenceId > 0 && node.getMessageId().getBrokerSequenceId() <= lastDeliveredSequenceId)) { Integer count = redeliveredMessages.get(node.getMessageId()); if (count != null) { - redeliveredMessages.put(node.getMessageId(), Integer.valueOf(count.intValue() + 1)); + redeliveredMessages.put(node.getMessageId(), count + 1); } else { - redeliveredMessages.put(node.getMessageId(), Integer.valueOf(1)); + redeliveredMessages.put(node.getMessageId(), 1); } } if (keepDurableSubsActive && pending.isTransient()) { @@ -272,7 +272,7 @@ public class DurableTopicSubscription extends PrefetchSubscription implements Us node.incrementReferenceCount(); Integer count = redeliveredMessages.get(node.getMessageId()); if (count != null) { - md.setRedeliveryCounter(count.intValue()); + md.setRedeliveryCounter(count); } } return md; diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java index 66fa2cf397..81ae20b6bb 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -304,7 +304,7 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index if ((recoveredAccumulator % 10000) == 0) { LOG.info("cursor for {} has recovered {} messages. {}% complete", getActiveMQDestination().getQualifiedName(), recoveredAccumulator, - Integer.valueOf((int) (recoveredAccumulator * 100 / totalMessageCount))); + (int) (recoveredAccumulator * 100 / totalMessageCount)); } // Message could have expired while it was being // loaded.. diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java index 50481a6579..2df9c2c909 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java @@ -753,7 +753,7 @@ public class RegionBroker extends EmptyBroker { boolean stamped = false; if (message.getProperty(ORIGINAL_EXPIRATION) == null) { long expiration = message.getExpiration(); - message.setProperty(ORIGINAL_EXPIRATION, Long.valueOf(expiration)); + message.setProperty(ORIGINAL_EXPIRATION, expiration); stamped = true; } return stamped; diff --git a/activemq-broker/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java b/activemq-broker/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java index e4581817ed..7195afb665 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java +++ b/activemq-broker/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java @@ -63,7 +63,7 @@ public class JAXPXPathEvaluator implements XPathExpression.XPathEvaluator { try { InputSource inputSource = new InputSource(new ByteArrayInputStream(data)); Document inputDocument = builder.parse(inputSource); - return ((Boolean)xpath.evaluate(xpathExpression, inputDocument, XPathConstants.BOOLEAN)).booleanValue(); + return (Boolean) xpath.evaluate(xpathExpression, inputDocument, XPathConstants.BOOLEAN); } catch (Exception e) { return false; } @@ -73,7 +73,7 @@ public class JAXPXPathEvaluator implements XPathExpression.XPathEvaluator { try { InputSource inputSource = new InputSource(new StringReader(text)); Document inputDocument = builder.parse(inputSource); - return ((Boolean)xpath.evaluate(xpathExpression, inputDocument, XPathConstants.BOOLEAN)).booleanValue(); + return (Boolean) xpath.evaluate(xpathExpression, inputDocument, XPathConstants.BOOLEAN); } catch (Exception e) { return false; } diff --git a/activemq-broker/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java b/activemq-broker/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java index 1b90e00f04..fdd4a316e5 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java +++ b/activemq-broker/src/main/java/org/apache/activemq/security/LDAPAuthorizationMap.java @@ -138,8 +138,8 @@ public class LDAPAuthorizationMap implements AuthorizationMap { String queueSearchSubtree = options.get(QUEUE_SEARCH_SUBTREE); topicSearchMatchingFormat = new MessageFormat(topicSearchMatching); queueSearchMatchingFormat = new MessageFormat(queueSearchMatching); - topicSearchSubtreeBool = Boolean.valueOf(topicSearchSubtree).booleanValue(); - queueSearchSubtreeBool = Boolean.valueOf(queueSearchSubtree).booleanValue(); + topicSearchSubtreeBool = Boolean.valueOf(topicSearchSubtree); + queueSearchSubtreeBool = Boolean.valueOf(queueSearchSubtree); } public Set getTempDestinationAdminACLs() { diff --git a/activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java b/activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java index bfab2eb78d..00b67d91af 100644 --- a/activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java +++ b/activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java @@ -185,7 +185,7 @@ public class CronParser { static void validate(final CronEntry entry) throws MessageFormatException { List list = entry.currentWhen; - if (list.isEmpty() || list.get(0).intValue() < entry.start || list.get(list.size() - 1).intValue() > entry.end) { + if (list.isEmpty() || list.get(0) < entry.start || list.get(list.size() - 1) > entry.end) { throw new MessageFormatException("Invalid token: " + entry); } } @@ -200,15 +200,15 @@ public class CronParser { List list = entry.currentWhen; int next = -1; for (Integer i : list) { - if (i.intValue() > current) { - next = i.intValue(); + if (i > current) { + next = i; break; } } if (next != -1) { result = next - current; } else { - int first = list.get(0).intValue(); + int first = list.get(0); int fixedEnd = entry.end; @@ -229,7 +229,7 @@ public class CronParser { } static boolean isCurrent(final CronEntry entry, final int current) throws MessageFormatException { - boolean result = entry.currentWhen.contains(Integer.valueOf(current)); + boolean result = entry.currentWhen.contains(current); return result; } @@ -265,7 +265,7 @@ public class CronParser { CronEntry ce = new CronEntry(entry.name, numerator, entry.start, entry.end); List list = calculateValues(ce); for (Integer i : list) { - if (i.intValue() % denominator == 0) { + if (i % denominator == 0) { result.add(i); } } diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java index 2800050b62..ecc16a0481 100644 --- a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java @@ -778,21 +778,21 @@ public class ActiveMQBytesMessage extends ActiveMQMessage implements BytesMessag } initializeWriting(); if (value instanceof Boolean) { - writeBoolean(((Boolean)value).booleanValue()); + writeBoolean((Boolean) value); } else if (value instanceof Character) { - writeChar(((Character)value).charValue()); + writeChar((Character) value); } else if (value instanceof Byte) { - writeByte(((Byte)value).byteValue()); + writeByte((Byte) value); } else if (value instanceof Short) { - writeShort(((Short)value).shortValue()); + writeShort((Short) value); } else if (value instanceof Integer) { - writeInt(((Integer)value).intValue()); + writeInt((Integer) value); } else if (value instanceof Long) { - writeLong(((Long)value).longValue()); + writeLong((Long) value); } else if (value instanceof Float) { - writeFloat(((Float)value).floatValue()); + writeFloat((Float) value); } else if (value instanceof Double) { - writeDouble(((Double)value).doubleValue()); + writeDouble((Double) value); } else if (value instanceof String) { writeUTF(value.toString()); } else if (value instanceof byte[]) { diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java index 5619e87e8c..3a3fa40f6f 100644 --- a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java @@ -243,13 +243,13 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return false; } if (value instanceof Boolean) { - return ((Boolean)value).booleanValue(); + return (Boolean) value; } if (value instanceof UTF8Buffer) { - return Boolean.valueOf(value.toString()).booleanValue(); + return Boolean.valueOf(value.toString()); } if (value instanceof String) { - return Boolean.valueOf(value.toString()).booleanValue(); + return Boolean.valueOf(value.toString()); } else { throw new MessageFormatException(" cannot read a boolean from " + value.getClass().getName()); } @@ -272,13 +272,13 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return 0; } if (value instanceof Byte) { - return ((Byte)value).byteValue(); + return (Byte) value; } if (value instanceof UTF8Buffer) { - return Byte.valueOf(value.toString()).byteValue(); + return Byte.valueOf(value.toString()); } if (value instanceof String) { - return Byte.valueOf(value.toString()).byteValue(); + return Byte.valueOf(value.toString()); } else { throw new MessageFormatException(" cannot read a byte from " + value.getClass().getName()); } @@ -301,16 +301,16 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return 0; } if (value instanceof Short) { - return ((Short)value).shortValue(); + return (Short) value; } if (value instanceof Byte) { return ((Byte)value).shortValue(); } if (value instanceof UTF8Buffer) { - return Short.valueOf(value.toString()).shortValue(); + return Short.valueOf(value.toString()); } if (value instanceof String) { - return Short.valueOf(value.toString()).shortValue(); + return Short.valueOf(value.toString()); } else { throw new MessageFormatException(" cannot read a short from " + value.getClass().getName()); } @@ -333,7 +333,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { if (value == null) { throw new NullPointerException(); } else if (value instanceof Character) { - return ((Character)value).charValue(); + return (Character) value; } else { throw new MessageFormatException(" cannot read a char from " + value.getClass().getName()); } @@ -356,7 +356,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return 0; } if (value instanceof Integer) { - return ((Integer)value).intValue(); + return (Integer) value; } if (value instanceof Short) { return ((Short)value).intValue(); @@ -365,10 +365,10 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return ((Byte)value).intValue(); } if (value instanceof UTF8Buffer) { - return Integer.valueOf(value.toString()).intValue(); + return Integer.valueOf(value.toString()); } if (value instanceof String) { - return Integer.valueOf(value.toString()).intValue(); + return Integer.valueOf(value.toString()); } else { throw new MessageFormatException(" cannot read an int from " + value.getClass().getName()); } @@ -391,7 +391,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return 0; } if (value instanceof Long) { - return ((Long)value).longValue(); + return (Long) value; } if (value instanceof Integer) { return ((Integer)value).longValue(); @@ -403,10 +403,10 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return ((Byte)value).longValue(); } if (value instanceof UTF8Buffer) { - return Long.valueOf(value.toString()).longValue(); + return Long.valueOf(value.toString()); } if (value instanceof String) { - return Long.valueOf(value.toString()).longValue(); + return Long.valueOf(value.toString()); } else { throw new MessageFormatException(" cannot read a long from " + value.getClass().getName()); } @@ -429,13 +429,13 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { return 0; } if (value instanceof Float) { - return ((Float)value).floatValue(); + return (Float) value; } if (value instanceof UTF8Buffer) { - return Float.valueOf(value.toString()).floatValue(); + return Float.valueOf(value.toString()); } if (value instanceof String) { - return Float.valueOf(value.toString()).floatValue(); + return Float.valueOf(value.toString()); } else { throw new MessageFormatException(" cannot read a float from " + value.getClass().getName()); } @@ -458,13 +458,13 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { if (value == null) { return 0; } else if (value instanceof Double) { - return ((Double)value).doubleValue(); + return (Double) value; } else if (value instanceof Float) { - return ((Float)value).floatValue(); + return (Float) value; } else if (value instanceof UTF8Buffer) { - return Double.valueOf(value.toString()).doubleValue(); + return Double.valueOf(value.toString()); } else if (value instanceof String) { - return Double.valueOf(value.toString()).doubleValue(); + return Double.valueOf(value.toString()); } else { throw new MessageFormatException("Cannot read a double from " + value.getClass().getName()); } @@ -603,7 +603,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { @Override public void setByte(String name, byte value) throws JMSException { initializeWriting(); - put(name, Byte.valueOf(value)); + put(name, value); } /** @@ -620,7 +620,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { @Override public void setShort(String name, short value) throws JMSException { initializeWriting(); - put(name, Short.valueOf(value)); + put(name, value); } /** @@ -637,7 +637,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { @Override public void setChar(String name, char value) throws JMSException { initializeWriting(); - put(name, Character.valueOf(value)); + put(name, value); } /** @@ -654,7 +654,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { @Override public void setInt(String name, int value) throws JMSException { initializeWriting(); - put(name, Integer.valueOf(value)); + put(name, value); } /** @@ -671,7 +671,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { @Override public void setLong(String name, long value) throws JMSException { initializeWriting(); - put(name, Long.valueOf(value)); + put(name, value); } /** @@ -688,7 +688,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { @Override public void setFloat(String name, float value) throws JMSException { initializeWriting(); - put(name, Float.valueOf(value)); + put(name, value); } /** @@ -705,7 +705,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { @Override public void setDouble(String name, double value) throws JMSException { initializeWriting(); - put(name, Double.valueOf(value)); + put(name, value); } /** diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMessage.java b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMessage.java index 49144b6a86..5c12ffe4ac 100644 --- a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMessage.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQMessage.java @@ -360,7 +360,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property JMSXDeliveryCount cannot be set from a " + value.getClass().getName() + "."); } - message.setRedeliveryCounter(rc.intValue() - 1); + message.setRedeliveryCounter(rc - 1); } }); JMS_PROPERTY_SETERS.put("JMSXGroupID", new PropertySetter() { @@ -380,7 +380,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property JMSXGroupSeq cannot be set from a " + value.getClass().getName() + "."); } - message.setGroupSequence(rc.intValue()); + message.setGroupSequence(rc); } }); JMS_PROPERTY_SETERS.put("JMSCorrelationID", new PropertySetter() { @@ -415,7 +415,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (bool == null) { throw new MessageFormatException("Property JMSDeliveryMode cannot be set from a " + value.getClass().getName() + "."); } else { - rc = bool.booleanValue() ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT; + rc = bool ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT; } } ((ActiveMQMessage) message).setJMSDeliveryMode(rc); @@ -428,7 +428,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property JMSExpiration cannot be set from a " + value.getClass().getName() + "."); } - ((ActiveMQMessage) message).setJMSExpiration(rc.longValue()); + ((ActiveMQMessage) message).setJMSExpiration(rc); } }); JMS_PROPERTY_SETERS.put("JMSPriority", new PropertySetter() { @@ -438,7 +438,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property JMSPriority cannot be set from a " + value.getClass().getName() + "."); } - ((ActiveMQMessage) message).setJMSPriority(rc.intValue()); + ((ActiveMQMessage) message).setJMSPriority(rc); } }); JMS_PROPERTY_SETERS.put("JMSRedelivered", new PropertySetter() { @@ -448,7 +448,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property JMSRedelivered cannot be set from a " + value.getClass().getName() + "."); } - ((ActiveMQMessage) message).setJMSRedelivered(rc.booleanValue()); + ((ActiveMQMessage) message).setJMSRedelivered(rc); } }); JMS_PROPERTY_SETERS.put("JMSReplyTo", new PropertySetter() { @@ -468,7 +468,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property JMSTimestamp cannot be set from a " + value.getClass().getName() + "."); } - ((ActiveMQMessage) message).setJMSTimestamp(rc.longValue()); + ((ActiveMQMessage) message).setJMSTimestamp(rc); } }); JMS_PROPERTY_SETERS.put("JMSType", new PropertySetter() { @@ -590,7 +590,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a boolean"); } - return rc.booleanValue(); + return rc; } @Override @@ -603,7 +603,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a byte"); } - return rc.byteValue(); + return rc; } @Override @@ -616,7 +616,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a short"); } - return rc.shortValue(); + return rc; } @Override @@ -629,7 +629,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as an integer"); } - return rc.intValue(); + return rc; } @Override @@ -642,7 +642,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a long"); } - return rc.longValue(); + return rc; } @Override @@ -655,7 +655,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a float"); } - return rc.floatValue(); + return rc; } @Override @@ -668,7 +668,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess if (rc == null) { throw new MessageFormatException("Property " + name + " was a " + value.getClass().getName() + " and cannot be read as a double"); } - return rc.doubleValue(); + return rc; } @Override @@ -698,37 +698,37 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess } public void setBooleanProperty(String name, boolean value, boolean checkReadOnly) throws JMSException { - setObjectProperty(name, Boolean.valueOf(value), checkReadOnly); + setObjectProperty(name, value, checkReadOnly); } @Override public void setByteProperty(String name, byte value) throws JMSException { - setObjectProperty(name, Byte.valueOf(value)); + setObjectProperty(name, value); } @Override public void setShortProperty(String name, short value) throws JMSException { - setObjectProperty(name, Short.valueOf(value)); + setObjectProperty(name, value); } @Override public void setIntProperty(String name, int value) throws JMSException { - setObjectProperty(name, Integer.valueOf(value)); + setObjectProperty(name, value); } @Override public void setLongProperty(String name, long value) throws JMSException { - setObjectProperty(name, Long.valueOf(value)); + setObjectProperty(name, value); } @Override public void setFloatProperty(String name, float value) throws JMSException { - setObjectProperty(name, Float.valueOf(value)); + setObjectProperty(name, value); } @Override public void setDoubleProperty(String name, double value) throws JMSException { - setObjectProperty(name, Double.valueOf(value)); + setObjectProperty(name, value); } @Override diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java index db66944349..290fbc09f2 100644 --- a/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java @@ -215,7 +215,7 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readBoolean(); } if (type == MarshallingSupport.STRING_TYPE) { - return Boolean.valueOf(this.dataIn.readUTF()).booleanValue(); + return Boolean.valueOf(this.dataIn.readUTF()); } if (type == MarshallingSupport.NULL) { this.dataIn.reset(); @@ -258,7 +258,7 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readByte(); } if (type == MarshallingSupport.STRING_TYPE) { - return Byte.valueOf(this.dataIn.readUTF()).byteValue(); + return Byte.valueOf(this.dataIn.readUTF()); } if (type == MarshallingSupport.NULL) { this.dataIn.reset(); @@ -311,7 +311,7 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readByte(); } if (type == MarshallingSupport.STRING_TYPE) { - return Short.valueOf(this.dataIn.readUTF()).shortValue(); + return Short.valueOf(this.dataIn.readUTF()); } if (type == MarshallingSupport.NULL) { this.dataIn.reset(); @@ -416,7 +416,7 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readByte(); } if (type == MarshallingSupport.STRING_TYPE) { - return Integer.valueOf(this.dataIn.readUTF()).intValue(); + return Integer.valueOf(this.dataIn.readUTF()); } if (type == MarshallingSupport.NULL) { this.dataIn.reset(); @@ -476,7 +476,7 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readByte(); } if (type == MarshallingSupport.STRING_TYPE) { - return Long.valueOf(this.dataIn.readUTF()).longValue(); + return Long.valueOf(this.dataIn.readUTF()); } if (type == MarshallingSupport.NULL) { this.dataIn.reset(); @@ -525,7 +525,7 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readFloat(); } if (type == MarshallingSupport.STRING_TYPE) { - return Float.valueOf(this.dataIn.readUTF()).floatValue(); + return Float.valueOf(this.dataIn.readUTF()); } if (type == MarshallingSupport.NULL) { this.dataIn.reset(); @@ -578,7 +578,7 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readFloat(); } if (type == MarshallingSupport.STRING_TYPE) { - return Double.valueOf(this.dataIn.readUTF()).doubleValue(); + return Double.valueOf(this.dataIn.readUTF()); } if (type == MarshallingSupport.NULL) { this.dataIn.reset(); @@ -808,28 +808,28 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess return this.dataIn.readUTF(); } if (type == MarshallingSupport.LONG_TYPE) { - return Long.valueOf(this.dataIn.readLong()); + return this.dataIn.readLong(); } if (type == MarshallingSupport.INTEGER_TYPE) { - return Integer.valueOf(this.dataIn.readInt()); + return this.dataIn.readInt(); } if (type == MarshallingSupport.SHORT_TYPE) { - return Short.valueOf(this.dataIn.readShort()); + return this.dataIn.readShort(); } if (type == MarshallingSupport.BYTE_TYPE) { - return Byte.valueOf(this.dataIn.readByte()); + return this.dataIn.readByte(); } if (type == MarshallingSupport.FLOAT_TYPE) { - return Float.valueOf(this.dataIn.readFloat()); + return this.dataIn.readFloat(); } if (type == MarshallingSupport.DOUBLE_TYPE) { - return Double.valueOf(this.dataIn.readDouble()); + return this.dataIn.readDouble(); } if (type == MarshallingSupport.BOOLEAN_TYPE) { return this.dataIn.readBoolean() ? Boolean.TRUE : Boolean.FALSE; } if (type == MarshallingSupport.CHAR_TYPE) { - return Character.valueOf(this.dataIn.readChar()); + return this.dataIn.readChar(); } if (type == MarshallingSupport.BYTE_ARRAY_TYPE) { int len = this.dataIn.readInt(); @@ -1106,23 +1106,23 @@ public class ActiveMQStreamMessage extends ActiveMQMessage implements StreamMess } else if (value instanceof String) { writeString(value.toString()); } else if (value instanceof Character) { - writeChar(((Character)value).charValue()); + writeChar((Character) value); } else if (value instanceof Boolean) { - writeBoolean(((Boolean)value).booleanValue()); + writeBoolean((Boolean) value); } else if (value instanceof Byte) { - writeByte(((Byte)value).byteValue()); + writeByte((Byte) value); } else if (value instanceof Short) { - writeShort(((Short)value).shortValue()); + writeShort((Short) value); } else if (value instanceof Integer) { - writeInt(((Integer)value).intValue()); + writeInt((Integer) value); } else if (value instanceof Float) { - writeFloat(((Float)value).floatValue()); + writeFloat((Float) value); } else if (value instanceof Double) { - writeDouble(((Double)value).doubleValue()); + writeDouble((Double) value); } else if (value instanceof byte[]) { writeBytes((byte[])value); }else if (value instanceof Long) { - writeLong(((Long)value).longValue()); + writeLong((Long) value); }else { throw new MessageFormatException("Unsupported Object type: " + value.getClass()); } diff --git a/activemq-client/src/main/java/org/apache/activemq/command/WireFormatInfo.java b/activemq-client/src/main/java/org/apache/activemq/command/WireFormatInfo.java index 98166ce693..3c51985b47 100644 --- a/activemq-client/src/main/java/org/apache/activemq/command/WireFormatInfo.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/WireFormatInfo.java @@ -281,29 +281,29 @@ public class WireFormatInfo implements Command, MarshallAware { */ public long getMaxInactivityDuration() throws IOException { Long l = (Long)getProperty("MaxInactivityDuration"); - return l == null ? 0 : l.longValue(); + return l == null ? 0 : l; } public void setMaxInactivityDuration(long maxInactivityDuration) throws IOException { - setProperty("MaxInactivityDuration", Long.valueOf(maxInactivityDuration)); + setProperty("MaxInactivityDuration", maxInactivityDuration); } public long getMaxInactivityDurationInitalDelay() throws IOException { Long l = (Long)getProperty("MaxInactivityDurationInitalDelay"); - return l == null ? 0 : l.longValue(); + return l == null ? 0 : l; } public void setMaxInactivityDurationInitalDelay(long maxInactivityDurationInitalDelay) throws IOException { - setProperty("MaxInactivityDurationInitalDelay", Long.valueOf(maxInactivityDurationInitalDelay)); + setProperty("MaxInactivityDurationInitalDelay", maxInactivityDurationInitalDelay); } public long getMaxFrameSize() throws IOException { Long l = (Long)getProperty("MaxFrameSize"); - return l == null ? 0 : l.longValue(); + return l == null ? 0 : l; } public void setMaxFrameSize(long maxFrameSize) throws IOException { - setProperty("MaxFrameSize", Long.valueOf(maxFrameSize)); + setProperty("MaxFrameSize", maxFrameSize); } /** @@ -311,11 +311,11 @@ public class WireFormatInfo implements Command, MarshallAware { */ public int getCacheSize() throws IOException { Integer i = (Integer)getProperty("CacheSize"); - return i == null ? 0 : i.intValue(); + return i == null ? 0 : i; } public void setCacheSize(int cacheSize) throws IOException { - setProperty("CacheSize", Integer.valueOf(cacheSize)); + setProperty("CacheSize", cacheSize); } /** diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/ArithmeticExpression.java b/activemq-client/src/main/java/org/apache/activemq/filter/ArithmeticExpression.java index f155664f93..e5f87ffa81 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/ArithmeticExpression.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/ArithmeticExpression.java @@ -122,42 +122,42 @@ public abstract class ArithmeticExpression extends BinaryExpression { protected Number plus(Number left, Number right) { switch (numberType(left, right)) { case INTEGER: - return Integer.valueOf(left.intValue() + right.intValue()); + return left.intValue() + right.intValue(); case LONG: - return Long.valueOf(left.longValue() + right.longValue()); + return left.longValue() + right.longValue(); default: - return Double.valueOf(left.doubleValue() + right.doubleValue()); + return left.doubleValue() + right.doubleValue(); } } protected Number minus(Number left, Number right) { switch (numberType(left, right)) { case INTEGER: - return Integer.valueOf(left.intValue() - right.intValue()); + return left.intValue() - right.intValue(); case LONG: - return Long.valueOf(left.longValue() - right.longValue()); + return left.longValue() - right.longValue(); default: - return Double.valueOf(left.doubleValue() - right.doubleValue()); + return left.doubleValue() - right.doubleValue(); } } protected Number multiply(Number left, Number right) { switch (numberType(left, right)) { case INTEGER: - return Integer.valueOf(left.intValue() * right.intValue()); + return left.intValue() * right.intValue(); case LONG: - return Long.valueOf(left.longValue() * right.longValue()); + return left.longValue() * right.longValue(); default: - return Double.valueOf(left.doubleValue() * right.doubleValue()); + return left.doubleValue() * right.doubleValue(); } } protected Number divide(Number left, Number right) { - return Double.valueOf(left.doubleValue() / right.doubleValue()); + return left.doubleValue() / right.doubleValue(); } protected Number mod(Number left, Number right) { - return Double.valueOf(left.doubleValue() % right.doubleValue()); + return left.doubleValue() % right.doubleValue(); } private int numberType(Number left, Number right) { diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/BooleanFunctionCallExpr.java b/activemq-client/src/main/java/org/apache/activemq/filter/BooleanFunctionCallExpr.java index dcd310228a..081bdc18d5 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/BooleanFunctionCallExpr.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/BooleanFunctionCallExpr.java @@ -58,7 +58,7 @@ public class BooleanFunctionCallExpr extends FunctionCallExpression implements B result = (Boolean) evaluate(message_ctx); if (result != null) - return result.booleanValue(); + return result; return false; } diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/ComparisonExpression.java b/activemq-client/src/main/java/org/apache/activemq/filter/ComparisonExpression.java index fb1284c12d..068e649df1 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/ComparisonExpression.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/ComparisonExpression.java @@ -53,26 +53,26 @@ public abstract class ComparisonExpression extends BinaryExpression implements B } static { - REGEXP_CONTROL_CHARS.add(Character.valueOf('.')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('\\')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('[')); - REGEXP_CONTROL_CHARS.add(Character.valueOf(']')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('^')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('$')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('?')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('*')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('+')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('{')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('}')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('|')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('(')); - REGEXP_CONTROL_CHARS.add(Character.valueOf(')')); - REGEXP_CONTROL_CHARS.add(Character.valueOf(':')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('&')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('<')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('>')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('=')); - REGEXP_CONTROL_CHARS.add(Character.valueOf('!')); + REGEXP_CONTROL_CHARS.add('.'); + REGEXP_CONTROL_CHARS.add('\\'); + REGEXP_CONTROL_CHARS.add('['); + REGEXP_CONTROL_CHARS.add(']'); + REGEXP_CONTROL_CHARS.add('^'); + REGEXP_CONTROL_CHARS.add('$'); + REGEXP_CONTROL_CHARS.add('?'); + REGEXP_CONTROL_CHARS.add('*'); + REGEXP_CONTROL_CHARS.add('+'); + REGEXP_CONTROL_CHARS.add('{'); + REGEXP_CONTROL_CHARS.add('}'); + REGEXP_CONTROL_CHARS.add('|'); + REGEXP_CONTROL_CHARS.add('('); + REGEXP_CONTROL_CHARS.add(')'); + REGEXP_CONTROL_CHARS.add(':'); + REGEXP_CONTROL_CHARS.add('&'); + REGEXP_CONTROL_CHARS.add('<'); + REGEXP_CONTROL_CHARS.add('>'); + REGEXP_CONTROL_CHARS.add('='); + REGEXP_CONTROL_CHARS.add('!'); } static class LikeExpression extends UnaryExpression implements BooleanExpression { @@ -116,7 +116,7 @@ public abstract class ComparisonExpression extends BinaryExpression implements B regexp.append(".*?"); // Do a non-greedy match } else if (c == '_') { regexp.append("."); // match one - } else if (REGEXP_CONTROL_CHARS.contains(Character.valueOf(c))) { + } else if (REGEXP_CONTROL_CHARS.contains(c)) { regexp.append("\\x"); regexp.append(Integer.toHexString(0xFFFF & c)); } else { @@ -404,21 +404,21 @@ public abstract class ComparisonExpression extends BinaryExpression implements B try { if (lc == Boolean.class) { if (convertStringExpressions && rc == String.class) { - lv = Boolean.valueOf((String)lv).booleanValue(); + lv = Boolean.valueOf((String) lv); } else { return Boolean.FALSE; } } else if (lc == Byte.class) { if (rc == Short.class) { - lv = Short.valueOf(((Number)lv).shortValue()); + lv = ((Number) lv).shortValue(); } else if (rc == Integer.class) { - lv = Integer.valueOf(((Number)lv).intValue()); + lv = ((Number) lv).intValue(); } else if (rc == Long.class) { - lv = Long.valueOf(((Number)lv).longValue()); + lv = ((Number) lv).longValue(); } else if (rc == Float.class) { - lv = Float.valueOf(((Number)lv).floatValue()); + lv = ((Number) lv).floatValue(); } else if (rc == Double.class) { - lv = Double.valueOf(((Number)lv).doubleValue()); + lv = ((Number) lv).doubleValue(); } else if (convertStringExpressions && rc == String.class) { rv = Byte.valueOf((String)rv); } else { @@ -426,13 +426,13 @@ public abstract class ComparisonExpression extends BinaryExpression implements B } } else if (lc == Short.class) { if (rc == Integer.class) { - lv = Integer.valueOf(((Number)lv).intValue()); + lv = ((Number) lv).intValue(); } else if (rc == Long.class) { - lv = Long.valueOf(((Number)lv).longValue()); + lv = ((Number) lv).longValue(); } else if (rc == Float.class) { - lv = Float.valueOf(((Number)lv).floatValue()); + lv = ((Number) lv).floatValue(); } else if (rc == Double.class) { - lv = Double.valueOf(((Number)lv).doubleValue()); + lv = ((Number) lv).doubleValue(); } else if (convertStringExpressions && rc == String.class) { rv = Short.valueOf((String)rv); } else { @@ -440,11 +440,11 @@ public abstract class ComparisonExpression extends BinaryExpression implements B } } else if (lc == Integer.class) { if (rc == Long.class) { - lv = Long.valueOf(((Number)lv).longValue()); + lv = ((Number) lv).longValue(); } else if (rc == Float.class) { - lv = Float.valueOf(((Number)lv).floatValue()); + lv = ((Number) lv).floatValue(); } else if (rc == Double.class) { - lv = Double.valueOf(((Number)lv).doubleValue()); + lv = ((Number) lv).doubleValue(); } else if (convertStringExpressions && rc == String.class) { rv = Integer.valueOf((String)rv); } else { @@ -452,11 +452,11 @@ public abstract class ComparisonExpression extends BinaryExpression implements B } } else if (lc == Long.class) { if (rc == Integer.class) { - rv = Long.valueOf(((Number)rv).longValue()); + rv = ((Number) rv).longValue(); } else if (rc == Float.class) { - lv = Float.valueOf(((Number)lv).floatValue()); + lv = ((Number) lv).floatValue(); } else if (rc == Double.class) { - lv = Double.valueOf(((Number)lv).doubleValue()); + lv = ((Number) lv).doubleValue(); } else if (convertStringExpressions && rc == String.class) { rv = Long.valueOf((String)rv); } else { @@ -464,11 +464,11 @@ public abstract class ComparisonExpression extends BinaryExpression implements B } } else if (lc == Float.class) { if (rc == Integer.class) { - rv = Float.valueOf(((Number)rv).floatValue()); + rv = ((Number) rv).floatValue(); } else if (rc == Long.class) { - rv = Float.valueOf(((Number)rv).floatValue()); + rv = ((Number) rv).floatValue(); } else if (rc == Double.class) { - lv = Double.valueOf(((Number)lv).doubleValue()); + lv = ((Number) lv).doubleValue(); } else if (convertStringExpressions && rc == String.class) { rv = Float.valueOf((String)rv); } else { @@ -476,11 +476,11 @@ public abstract class ComparisonExpression extends BinaryExpression implements B } } else if (lc == Double.class) { if (rc == Integer.class) { - rv = Double.valueOf(((Number)rv).doubleValue()); + rv = ((Number) rv).doubleValue(); } else if (rc == Long.class) { - rv = Double.valueOf(((Number)rv).doubleValue()); + rv = ((Number) rv).doubleValue(); } else if (rc == Float.class) { - rv = new Float(((Number)rv).doubleValue()); + rv = (float) ((Number) rv).doubleValue(); } else if (convertStringExpressions && rc == String.class) { rv = Double.valueOf((String)rv); } else { diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/ConstantExpression.java b/activemq-client/src/main/java/org/apache/activemq/filter/ConstantExpression.java index 47c1a5e0a5..ff57cd79a0 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/ConstantExpression.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/ConstantExpression.java @@ -65,25 +65,25 @@ public class ConstantExpression implements Expression { long l = value.longValue(); if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { - value = Integer.valueOf(value.intValue()); + value = value.intValue(); } return new ConstantExpression(value); } public static ConstantExpression createFromHex(String text) { - Number value = Long.valueOf(Long.parseLong(text.substring(2), 16)); + Number value = Long.parseLong(text.substring(2), 16); long l = value.longValue(); if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { - value = Integer.valueOf(value.intValue()); + value = value.intValue(); } return new ConstantExpression(value); } public static ConstantExpression createFromOctal(String text) { - Number value = Long.valueOf(Long.parseLong(text, 8)); + Number value = Long.parseLong(text, 8); long l = value.longValue(); if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { - value = Integer.valueOf(value.intValue()); + value = value.intValue(); } return new ConstantExpression(value); } @@ -109,7 +109,7 @@ public class ConstantExpression implements Expression { return "NULL"; } if (value instanceof Boolean) { - return ((Boolean)value).booleanValue() ? "TRUE" : "FALSE"; + return (Boolean) value ? "TRUE" : "FALSE"; } if (value instanceof String) { return encodeString((String)value); diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/LogicExpression.java b/activemq-client/src/main/java/org/apache/activemq/filter/LogicExpression.java index 0652431cbe..f36ea66a9c 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/LogicExpression.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/LogicExpression.java @@ -113,7 +113,7 @@ public abstract class LogicExpression implements BooleanExpression { boolean someNulls = false; for (BooleanExpression expression : expressions) { Boolean lv = (Boolean)expression.evaluate(message); - if (lv != null && lv.booleanValue()) { + if (lv != null && lv) { return Boolean.TRUE; } if (lv == null) { @@ -154,7 +154,7 @@ public abstract class LogicExpression implements BooleanExpression { boolean someNulls = false; for (BooleanExpression expression : expressions) { Boolean lv = (Boolean)expression.evaluate(message); - if (lv != null && !lv.booleanValue()) { + if (lv != null && !lv) { return Boolean.FALSE; } if (lv == null) { diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/PropertyExpression.java b/activemq-client/src/main/java/org/apache/activemq/filter/PropertyExpression.java index 730a1b1df5..eb11ef3c35 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/PropertyExpression.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/PropertyExpression.java @@ -83,7 +83,7 @@ public class PropertyExpression implements Expression { @Override public Object evaluate(Message message) { - return Integer.valueOf(message.getPriority()); + return (int) message.getPriority(); } }); JMS_PROPERTY_EXPRESSIONS.put("JMSMessageID", new SubExpression() { @@ -100,7 +100,7 @@ public class PropertyExpression implements Expression { @Override public Object evaluate(Message message) { - return Long.valueOf(message.getTimestamp()); + return message.getTimestamp(); } }); JMS_PROPERTY_EXPRESSIONS.put("JMSCorrelationID", new SubExpression() { @@ -114,21 +114,21 @@ public class PropertyExpression implements Expression { @Override public Object evaluate(Message message) { - return Long.valueOf(message.getExpiration()); + return message.getExpiration(); } }); JMS_PROPERTY_EXPRESSIONS.put("JMSRedelivered", new SubExpression() { @Override public Object evaluate(Message message) { - return Boolean.valueOf(message.isRedelivered()); + return message.isRedelivered(); } }); JMS_PROPERTY_EXPRESSIONS.put("JMSXDeliveryCount", new SubExpression() { @Override public Object evaluate(Message message) { - return Integer.valueOf(message.getRedeliveryCounter() + 1); + return message.getRedeliveryCounter() + 1; } }); JMS_PROPERTY_EXPRESSIONS.put("JMSXGroupID", new SubExpression() { @@ -157,7 +157,7 @@ public class PropertyExpression implements Expression { @Override public Object evaluate(Message message) { - return Integer.valueOf(message.getGroupSequence()); + return message.getGroupSequence(); } }); JMS_PROPERTY_EXPRESSIONS.put("JMSXProducerTXID", new SubExpression() { @@ -178,14 +178,14 @@ public class PropertyExpression implements Expression { @Override public Object evaluate(Message message) { - return Long.valueOf(message.getBrokerInTime()); + return message.getBrokerInTime(); } }); JMS_PROPERTY_EXPRESSIONS.put("JMSActiveMQBrokerOutTime", new SubExpression() { @Override public Object evaluate(Message message) { - return Long.valueOf(message.getBrokerOutTime()); + return message.getBrokerOutTime(); } }); JMS_PROPERTY_EXPRESSIONS.put("JMSActiveMQBrokerPath", new SubExpression() { @@ -199,7 +199,7 @@ public class PropertyExpression implements Expression { @Override public Object evaluate(Message message) { - return Boolean.valueOf(message.isJMSXGroupFirstForConsumer()); + return message.isJMSXGroupFirstForConsumer(); } }); } diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/UnaryExpression.java b/activemq-client/src/main/java/org/apache/activemq/filter/UnaryExpression.java index e4638406c5..6960eaf2f5 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/UnaryExpression.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/UnaryExpression.java @@ -152,7 +152,7 @@ public abstract class UnaryExpression implements Expression { if (!rvalue.getClass().equals(Boolean.class)) { return Boolean.FALSE; } - return ((Boolean)rvalue).booleanValue() ? Boolean.TRUE : Boolean.FALSE; + return (Boolean) rvalue ? Boolean.TRUE : Boolean.FALSE; } public String toString() { @@ -168,13 +168,13 @@ public abstract class UnaryExpression implements Expression { private static Number negate(Number left) { Class clazz = left.getClass(); if (clazz == Integer.class) { - return Integer.valueOf(-left.intValue()); + return -left.intValue(); } else if (clazz == Long.class) { - return Long.valueOf(-left.longValue()); + return -left.longValue(); } else if (clazz == Float.class) { - return Float.valueOf(-left.floatValue()); + return -left.floatValue(); } else if (clazz == Double.class) { - return Double.valueOf(-left.doubleValue()); + return -left.doubleValue(); } else if (clazz == BigDecimal.class) { // We ussually get a big deciamal when we have Long.MIN_VALUE // constant in the @@ -187,7 +187,7 @@ public abstract class UnaryExpression implements Expression { bd = bd.negate(); if (BD_LONG_MIN_VALUE.compareTo(bd) == 0) { - return Long.valueOf(Long.MIN_VALUE); + return Long.MIN_VALUE; } return bd; } else { diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/function/inListFunction.java b/activemq-client/src/main/java/org/apache/activemq/filter/function/inListFunction.java index 7fa38abd3e..42b4754d9e 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/function/inListFunction.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/function/inListFunction.java @@ -88,6 +88,6 @@ public class inListFunction implements FilterFunction { cur++; } - return Boolean.valueOf(found_f); + return found_f; } } diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/function/regexMatchFunction.java b/activemq-client/src/main/java/org/apache/activemq/filter/function/regexMatchFunction.java index 757d776140..48839466ee 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/function/regexMatchFunction.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/function/regexMatchFunction.java @@ -121,7 +121,7 @@ public class regexMatchFunction implements FilterFunction { // point in the candidate (see Matcher#find()). // - return Boolean.valueOf(match_eng.find()); + return match_eng.find(); } } diff --git a/activemq-client/src/main/java/org/apache/activemq/filter/function/splitFunction.java b/activemq-client/src/main/java/org/apache/activemq/filter/function/splitFunction.java index c87105ed1c..fe99cbb88d 100644 --- a/activemq-client/src/main/java/org/apache/activemq/filter/function/splitFunction.java +++ b/activemq-client/src/main/java/org/apache/activemq/filter/function/splitFunction.java @@ -77,7 +77,7 @@ public class splitFunction implements FilterFunction { limit = (Integer) expr.getArgument(2).evaluate(message_ctx); - result = src.split(split_pat, limit.intValue()); + result = src.split(split_pat, limit); } else { result = src.split(split_pat); } diff --git a/activemq-client/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java b/activemq-client/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java index f1ec271f84..0b6816029c 100644 --- a/activemq-client/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java +++ b/activemq-client/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java @@ -532,13 +532,13 @@ public final class OpenWireFormat implements WireFormat { // We can only cache that item if there is space left. if (marshallCacheMap.size() < marshallCache.length) { marshallCache[i] = o; - Short index = Short.valueOf(i); + Short index = i; marshallCacheMap.put(o, index); return index; } else { // Use -1 to indicate that the value was not cached due to cache // being full. - return Short.valueOf((short)-1); + return (short) -1; } } diff --git a/activemq-client/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java b/activemq-client/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java index 94ba66d405..9e00ae3eb9 100644 --- a/activemq-client/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java +++ b/activemq-client/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java @@ -176,10 +176,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); if (bs.readBoolean()) { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.tightMarshalNestedObject2(o, dataOut, bs); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.tightMarshalNestedObject2(o, dataOut, bs); @@ -201,7 +201,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { @@ -497,10 +497,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { dataOut.writeBoolean(index == null); if (index == null) { index = wireFormat.addToMarshallCache(o); - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.looseMarshalNestedObject(o, dataOut); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.looseMarshalNestedObject(o, dataOut); @@ -522,7 +522,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { @@ -647,6 +647,6 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { protected String cutMessageIfNeeded(final String message) { return (message.length() > MAX_EXCEPTION_MESSAGE_SIZE)? message.substring(0, MAX_EXCEPTION_MESSAGE_SIZE - 3) + "..." : message; - + } } diff --git a/activemq-client/src/main/java/org/apache/activemq/openwire/v10/BaseDataStreamMarshaller.java b/activemq-client/src/main/java/org/apache/activemq/openwire/v10/BaseDataStreamMarshaller.java index a570d3d17d..7e871f7ea9 100644 --- a/activemq-client/src/main/java/org/apache/activemq/openwire/v10/BaseDataStreamMarshaller.java +++ b/activemq-client/src/main/java/org/apache/activemq/openwire/v10/BaseDataStreamMarshaller.java @@ -175,10 +175,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); if (bs.readBoolean()) { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.tightMarshalNestedObject2(o, dataOut, bs); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.tightMarshalNestedObject2(o, dataOut, bs); @@ -200,7 +200,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { @@ -496,10 +496,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { dataOut.writeBoolean(index == null); if (index == null) { index = wireFormat.addToMarshallCache(o); - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.looseMarshalNestedObject(o, dataOut); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.looseMarshalNestedObject(o, dataOut); @@ -521,7 +521,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { diff --git a/activemq-client/src/main/java/org/apache/activemq/openwire/v11/BaseDataStreamMarshaller.java b/activemq-client/src/main/java/org/apache/activemq/openwire/v11/BaseDataStreamMarshaller.java index c61d16fa32..99eb810673 100644 --- a/activemq-client/src/main/java/org/apache/activemq/openwire/v11/BaseDataStreamMarshaller.java +++ b/activemq-client/src/main/java/org/apache/activemq/openwire/v11/BaseDataStreamMarshaller.java @@ -174,10 +174,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); if (bs.readBoolean()) { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.tightMarshalNestedObject2(o, dataOut, bs); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.tightMarshalNestedObject2(o, dataOut, bs); @@ -199,7 +199,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { @@ -495,10 +495,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { dataOut.writeBoolean(index == null); if (index == null) { index = wireFormat.addToMarshallCache(o); - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.looseMarshalNestedObject(o, dataOut); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.looseMarshalNestedObject(o, dataOut); @@ -520,7 +520,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { diff --git a/activemq-client/src/main/java/org/apache/activemq/openwire/v12/BaseDataStreamMarshaller.java b/activemq-client/src/main/java/org/apache/activemq/openwire/v12/BaseDataStreamMarshaller.java index 820d9a632c..50dab35f4e 100644 --- a/activemq-client/src/main/java/org/apache/activemq/openwire/v12/BaseDataStreamMarshaller.java +++ b/activemq-client/src/main/java/org/apache/activemq/openwire/v12/BaseDataStreamMarshaller.java @@ -174,10 +174,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); if (bs.readBoolean()) { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.tightMarshalNestedObject2(o, dataOut, bs); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.tightMarshalNestedObject2(o, dataOut, bs); @@ -199,7 +199,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { @@ -495,10 +495,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { dataOut.writeBoolean(index == null); if (index == null) { index = wireFormat.addToMarshallCache(o); - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.looseMarshalNestedObject(o, dataOut); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.looseMarshalNestedObject(o, dataOut); @@ -520,7 +520,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { diff --git a/activemq-client/src/main/java/org/apache/activemq/openwire/v9/BaseDataStreamMarshaller.java b/activemq-client/src/main/java/org/apache/activemq/openwire/v9/BaseDataStreamMarshaller.java index 80abd32dc3..07058a586f 100644 --- a/activemq-client/src/main/java/org/apache/activemq/openwire/v9/BaseDataStreamMarshaller.java +++ b/activemq-client/src/main/java/org/apache/activemq/openwire/v9/BaseDataStreamMarshaller.java @@ -174,10 +174,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { if (wireFormat.isCacheEnabled()) { Short index = wireFormat.getMarshallCacheIndex(o); if (bs.readBoolean()) { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.tightMarshalNestedObject2(o, dataOut, bs); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.tightMarshalNestedObject2(o, dataOut, bs); @@ -199,7 +199,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), tightUnmarshalString(dataIn, bs), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { @@ -495,10 +495,10 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { dataOut.writeBoolean(index == null); if (index == null) { index = wireFormat.addToMarshallCache(o); - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); wireFormat.looseMarshalNestedObject(o, dataOut); } else { - dataOut.writeShort(index.shortValue()); + dataOut.writeShort(index); } } else { wireFormat.looseMarshalNestedObject(o, dataOut); @@ -520,7 +520,7 @@ public abstract class BaseDataStreamMarshaller implements DataStreamMarshaller { .newInstance(new Object[] {looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), looseUnmarshalString(dataIn), - Integer.valueOf(dataIn.readInt())}); + dataIn.readInt()}); } catch (IOException e) { throw e; } catch (Throwable e) { diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java b/activemq-client/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java index 6d12d8f2c8..7e9112ab91 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java @@ -69,7 +69,7 @@ public class ResponseCorrelator extends TransportFilter { synchronized (requestMap) { priorError = this.error; if (priorError == null) { - requestMap.put(Integer.valueOf(command.getCommandId()), future); + requestMap.put(command.getCommandId(), future); } } @@ -103,7 +103,7 @@ public class ResponseCorrelator extends TransportFilter { Response response = (Response)command; FutureResponse future = null; synchronized (requestMap) { - future = requestMap.remove(Integer.valueOf(response.getCorrelationId())); + future = requestMap.remove(response.getCorrelationId()); } if (future != null) { future.set(response); diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java b/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java index 76062e4178..05f2d28020 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java @@ -191,7 +191,7 @@ public class FailoverTransport implements CompositeTransport { if (command.isResponse()) { Object object = null; synchronized (requestMap) { - object = requestMap.remove(Integer.valueOf(((Response) command).getCorrelationId())); + object = requestMap.remove(((Response) command).getCorrelationId()); } if (object != null && object.getClass() == Tracked.class) { ((Tracked) object).onResponses(command); @@ -659,9 +659,9 @@ public class FailoverTransport implements CompositeTransport { // it later. synchronized (requestMap) { if (tracked != null && tracked.isWaitingForResponse()) { - requestMap.put(Integer.valueOf(command.getCommandId()), tracked); + requestMap.put(command.getCommandId(), tracked); } else if (tracked == null && command.isResponseRequired()) { - requestMap.put(Integer.valueOf(command.getCommandId()), command); + requestMap.put(command.getCommandId(), command); } } @@ -683,7 +683,7 @@ public class FailoverTransport implements CompositeTransport { // map so that it is not sent 2 times on // recovery if (command.isResponseRequired()) { - requestMap.remove(Integer.valueOf(command.getCommandId())); + requestMap.remove(command.getCommandId()); } // Rethrow the exception so it will handled by diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java b/activemq-client/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java index 4935029309..fa618e0889 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/fanout/FanoutTransport.java @@ -115,7 +115,7 @@ public class FanoutTransport implements CompositeTransport { public void onCommand(Object o) { Command command = (Command) o; if (command.isResponse()) { - Integer id = Integer.valueOf(((Response) command).getCorrelationId()); + Integer id = ((Response) command).getCorrelationId(); RequestCounter rc = requestMap.get(id); if (rc != null) { if (rc.ackCount.decrementAndGet() <= 0) { @@ -403,7 +403,7 @@ public class FanoutTransport implements CompositeTransport { boolean fanout = isFanoutCommand(command); if (stateTracker.track(command) == null && command.isResponseRequired()) { int size = fanout ? minAckCount : 1; - requestMap.put(Integer.valueOf(command.getCommandId()), new RequestCounter(command, size)); + requestMap.put(command.getCommandId(), new RequestCounter(command, size)); } // Send the message. diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java b/activemq-client/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java index 77c821f6b7..c228e2806d 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/reliable/DefaultReplayBuffer.java @@ -50,10 +50,10 @@ public class DefaultReplayBuffer implements ReplayBuffer { int max = size - 1; while (map.size() >= max) { // lets find things to evict - Object evictedBuffer = map.remove(Integer.valueOf(++lowestCommandId)); + Object evictedBuffer = map.remove(++lowestCommandId); onEvictedBuffer(lowestCommandId, evictedBuffer); } - map.put(Integer.valueOf(commandId), buffer); + map.put(commandId, buffer); } } @@ -71,7 +71,7 @@ public class DefaultReplayBuffer implements ReplayBuffer { for (int i = fromCommandId; i <= toCommandId; i++) { Object buffer = null; synchronized (lock) { - buffer = map.get(Integer.valueOf(i)); + buffer = map.get(i); } replayer.sendBuffer(i, buffer); } diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java index 08a7d80e75..947110f07b 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java @@ -467,7 +467,7 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S sock.setSoTimeout(soTimeout); if (keepAlive != null) { - sock.setKeepAlive(keepAlive.booleanValue()); + sock.setKeepAlive(keepAlive); } if (soLinger > -1) { @@ -476,7 +476,7 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S sock.setSoLinger(false, 0); } if (tcpNoDelay != null) { - sock.setTcpNoDelay(tcpNoDelay.booleanValue()); + sock.setTcpNoDelay(tcpNoDelay); } if (!this.trafficClassSet) { this.trafficClassSet = setTrafficClass(sock); diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java index 667cb34bc1..32cc6261c2 100644 --- a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java +++ b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java @@ -596,17 +596,17 @@ public class TcpTransportServer extends TransportServerThreadSupport implements countIncremented = true; HashMap options = new HashMap(); - options.put("maxInactivityDuration", Long.valueOf(maxInactivityDuration)); - options.put("maxInactivityDurationInitalDelay", Long.valueOf(maxInactivityDurationInitalDelay)); - options.put("minmumWireFormatVersion", Integer.valueOf(minmumWireFormatVersion)); - options.put("trace", Boolean.valueOf(trace)); - options.put("soTimeout", Integer.valueOf(soTimeout)); - options.put("socketBufferSize", Integer.valueOf(socketBufferSize)); - options.put("connectionTimeout", Integer.valueOf(connectionTimeout)); + options.put("maxInactivityDuration", maxInactivityDuration); + options.put("maxInactivityDurationInitalDelay", maxInactivityDurationInitalDelay); + options.put("minmumWireFormatVersion", minmumWireFormatVersion); + options.put("trace", trace); + options.put("soTimeout", soTimeout); + options.put("socketBufferSize", socketBufferSize); + options.put("connectionTimeout", connectionTimeout); options.put("logWriterName", logWriterName); - options.put("dynamicManagement", Boolean.valueOf(dynamicManagement)); - options.put("startLogging", Boolean.valueOf(startLogging)); - options.put("jmxPort", Integer.valueOf(jmxPort)); + options.put("dynamicManagement", dynamicManagement); + options.put("startLogging", startLogging); + options.put("jmxPort", jmxPort); options.putAll(transportOptions); TransportInfo transportInfo = configureTransport(this, socket); diff --git a/activemq-client/src/main/java/org/apache/activemq/util/MarshallingSupport.java b/activemq-client/src/main/java/org/apache/activemq/util/MarshallingSupport.java index 4962cf7787..54bd8e4e7c 100644 --- a/activemq-client/src/main/java/org/apache/activemq/util/MarshallingSupport.java +++ b/activemq-client/src/main/java/org/apache/activemq/util/MarshallingSupport.java @@ -125,21 +125,21 @@ public final class MarshallingSupport { if (value == null) { marshalNull(out); } else if (value.getClass() == Boolean.class) { - marshalBoolean(out, ((Boolean)value).booleanValue()); + marshalBoolean(out, (Boolean) value); } else if (value.getClass() == Byte.class) { - marshalByte(out, ((Byte)value).byteValue()); + marshalByte(out, (Byte) value); } else if (value.getClass() == Character.class) { - marshalChar(out, ((Character)value).charValue()); + marshalChar(out, (Character) value); } else if (value.getClass() == Short.class) { - marshalShort(out, ((Short)value).shortValue()); + marshalShort(out, (Short) value); } else if (value.getClass() == Integer.class) { - marshalInt(out, ((Integer)value).intValue()); + marshalInt(out, (Integer) value); } else if (value.getClass() == Long.class) { - marshalLong(out, ((Long)value).longValue()); + marshalLong(out, (Long) value); } else if (value.getClass() == Float.class) { - marshalFloat(out, ((Float)value).floatValue()); + marshalFloat(out, (Float) value); } else if (value.getClass() == Double.class) { - marshalDouble(out, ((Double)value).doubleValue()); + marshalDouble(out, (Double) value); } else if (value.getClass() == byte[].class) { marshalByteArray(out, (byte[])value); } else if (value.getClass() == String.class) { @@ -166,28 +166,28 @@ public final class MarshallingSupport { byte type = in.readByte(); switch (type) { case BYTE_TYPE: - value = Byte.valueOf(in.readByte()); + value = in.readByte(); break; case BOOLEAN_TYPE: value = in.readBoolean() ? Boolean.TRUE : Boolean.FALSE; break; case CHAR_TYPE: - value = Character.valueOf(in.readChar()); + value = in.readChar(); break; case SHORT_TYPE: - value = Short.valueOf(in.readShort()); + value = in.readShort(); break; case INTEGER_TYPE: - value = Integer.valueOf(in.readInt()); + value = in.readInt(); break; case LONG_TYPE: - value = Long.valueOf(in.readLong()); + value = in.readLong(); break; case FLOAT_TYPE: - value = Float.valueOf(in.readFloat()); + value = in.readFloat(); break; case DOUBLE_TYPE: - value = Double.valueOf(in.readDouble()); + value = in.readDouble(); break; case BYTE_ARRAY_TYPE: value = new byte[in.readInt()]; diff --git a/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java b/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java index 6ece357a69..52299aac33 100644 --- a/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java +++ b/activemq-client/src/main/java/org/apache/activemq/util/TypeConversionSupport.java @@ -146,7 +146,7 @@ public final class TypeConversionSupport { Converter longConverter = new Converter() { @Override public Object convert(Object value) { - return Long.valueOf(((Number)value).longValue()); + return ((Number) value).longValue(); } }; CONVERSION_MAP.put(new ConversionKey(Byte.class, Long.class), longConverter); @@ -155,14 +155,14 @@ public final class TypeConversionSupport { CONVERSION_MAP.put(new ConversionKey(Date.class, Long.class), new Converter() { @Override public Object convert(Object value) { - return Long.valueOf(((Date)value).getTime()); + return ((Date) value).getTime(); } }); Converter intConverter = new Converter() { @Override public Object convert(Object value) { - return Integer.valueOf(((Number)value).intValue()); + return ((Number) value).intValue(); } }; CONVERSION_MAP.put(new ConversionKey(Byte.class, Integer.class), intConverter); @@ -171,14 +171,14 @@ public final class TypeConversionSupport { CONVERSION_MAP.put(new ConversionKey(Byte.class, Short.class), new Converter() { @Override public Object convert(Object value) { - return Short.valueOf(((Number)value).shortValue()); + return ((Number) value).shortValue(); } }); CONVERSION_MAP.put(new ConversionKey(Float.class, Double.class), new Converter() { @Override public Object convert(Object value) { - return Double.valueOf(((Number)value).doubleValue()); + return ((Number) value).doubleValue(); } }); CONVERSION_MAP.put(new ConversionKey(String.class, ActiveMQDestination.class), new Converter() { diff --git a/activemq-client/src/test/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStreamTest.java b/activemq-client/src/test/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStreamTest.java index 2e3e919ee4..7be8656dbf 100644 --- a/activemq-client/src/test/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStreamTest.java +++ b/activemq-client/src/test/java/org/apache/activemq/util/ClassLoadingAwareObjectInputStreamTest.java @@ -101,32 +101,32 @@ public class ClassLoadingAwareObjectInputStreamTest { @Test public void testReadObjectByte() throws Exception { - doTestReadObject(Byte.valueOf((byte) 255), ACCEPTS_ALL_FILTER); + doTestReadObject((byte) 255, ACCEPTS_ALL_FILTER); } @Test public void testReadObjectShort() throws Exception { - doTestReadObject(Short.valueOf((short) 255), ACCEPTS_ALL_FILTER); + doTestReadObject((short) 255, ACCEPTS_ALL_FILTER); } @Test public void testReadObjectInteger() throws Exception { - doTestReadObject(Integer.valueOf(255), ACCEPTS_ALL_FILTER); + doTestReadObject(255, ACCEPTS_ALL_FILTER); } @Test public void testReadObjectLong() throws Exception { - doTestReadObject(Long.valueOf(255l), ACCEPTS_ALL_FILTER); + doTestReadObject(255L, ACCEPTS_ALL_FILTER); } @Test public void testReadObjectFloat() throws Exception { - doTestReadObject(Float.valueOf(255.0f), ACCEPTS_ALL_FILTER); + doTestReadObject(255.0f, ACCEPTS_ALL_FILTER); } @Test public void testReadObjectDouble() throws Exception { - doTestReadObject(Double.valueOf(255.0), ACCEPTS_ALL_FILTER); + doTestReadObject(255.0, ACCEPTS_ALL_FILTER); } @Test @@ -321,7 +321,7 @@ public class ClassLoadingAwareObjectInputStreamTest { } // Replace the filtered type and try again - value[3] = Integer.valueOf(20); + value[3] = 20; serialized = serializeObject(value); diff --git a/activemq-client/src/test/java/org/apache/activemq/util/IntrospectionSupportTest.java b/activemq-client/src/test/java/org/apache/activemq/util/IntrospectionSupportTest.java index 5dfc99a0ef..f0993989cb 100644 --- a/activemq-client/src/test/java/org/apache/activemq/util/IntrospectionSupportTest.java +++ b/activemq-client/src/test/java/org/apache/activemq/util/IntrospectionSupportTest.java @@ -42,7 +42,7 @@ public class IntrospectionSupportTest { @Test public void testSetPropertyPrimitiveWithWrapperValue() { // Wrapper value - Boolean value = Boolean.valueOf(true); + Boolean value = Boolean.TRUE; DummyClass dummyClass = new DummyClass(false); dummyClass.setTrace(false); diff --git a/activemq-client/src/test/java/org/apache/activemq/util/LRUCacheTest.java b/activemq-client/src/test/java/org/apache/activemq/util/LRUCacheTest.java index 67761b2678..39f090005d 100644 --- a/activemq-client/src/test/java/org/apache/activemq/util/LRUCacheTest.java +++ b/activemq-client/src/test/java/org/apache/activemq/util/LRUCacheTest.java @@ -29,7 +29,7 @@ public class LRUCacheTest { public void testResize() throws Exception { LRUCache underTest = new LRUCache(1000); - Long count = Long.valueOf(0); + Long count = 0L; long max = 0; for (; count < 27276827; count++) { long start = System.currentTimeMillis(); diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/ShutdownCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/ShutdownCommand.java index a88506b709..1cecce072f 100644 --- a/activemq-console/src/main/java/org/apache/activemq/console/command/ShutdownCommand.java +++ b/activemq-console/src/main/java/org/apache/activemq/console/command/ShutdownCommand.java @@ -129,7 +129,7 @@ public class ShutdownCommand extends AbstractJmxCommand { try { jmxConnection.invoke(brokerObjName, "terminateJVM", new Object[] { - Integer.valueOf(0) + 0 }, new String[] { "int" }); diff --git a/activemq-console/src/main/java/org/apache/activemq/console/filter/MBeansRegExQueryFilter.java b/activemq-console/src/main/java/org/apache/activemq/console/filter/MBeansRegExQueryFilter.java index 0e83c367ba..692de5efd8 100644 --- a/activemq-console/src/main/java/org/apache/activemq/console/filter/MBeansRegExQueryFilter.java +++ b/activemq-console/src/main/java/org/apache/activemq/console/filter/MBeansRegExQueryFilter.java @@ -58,9 +58,9 @@ public class MBeansRegExQueryFilter extends RegExQueryFilter { Method method = this.getClass().getDeclaredMethod("matches", new Class[] { data.getClass(), Map.class }); - return ((Boolean)method.invoke(this, new Object[] { - data, regex - })).booleanValue(); + return (Boolean) method.invoke(this, new Object[]{ + data, regex + }); } catch (NoSuchMethodException e) { return false; } diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/http/HttpJMSMessagesWithCompressionTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/http/HttpJMSMessagesWithCompressionTest.java index 15d671e348..980c043214 100644 --- a/activemq-http/src/test/java/org/apache/activemq/transport/http/HttpJMSMessagesWithCompressionTest.java +++ b/activemq-http/src/test/java/org/apache/activemq/transport/http/HttpJMSMessagesWithCompressionTest.java @@ -187,7 +187,7 @@ public class HttpJMSMessagesWithCompressionTest { @Test public void testObjectMessage() throws Exception { executeTest(new MessageCommand() { - private Long value = Long.valueOf(101); + private Long value = 101L; public ObjectMessage createMessage(Session session) throws JMSException { return session.createObjectMessage(value); @@ -202,7 +202,7 @@ public class HttpJMSMessagesWithCompressionTest { @Test public void testStreamMessage() throws Exception { executeTest(new MessageCommand() { - private Long value = Long.valueOf(1013); + private Long value = 1013L; public StreamMessage createMessage(Session session) throws JMSException { StreamMessage message = session.createStreamMessage(); diff --git a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java index 803e72a445..d21399e153 100644 --- a/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java +++ b/activemq-jms-pool/src/test/java/org/apache/activemq/jms/pool/PooledConnectionFactoryTest.java @@ -331,7 +331,7 @@ public class PooledConnectionFactoryTest extends JmsPoolTestSupport { @Override public boolean isSatisified() throws Exception { - return result.isDone() && result.get().booleanValue(); + return result.isDone() && result.get(); } }, TimeUnit.SECONDS.toMillis(10), TimeUnit.MILLISECONDS.toMillis(50)); diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java index 6687c56b49..567a032920 100644 --- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java +++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java @@ -1682,7 +1682,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe } private void recordAckMessageReferenceLocation(Location ackLocation, Location messageLocation) { - Set referenceFileIds = metadata.ackMessageFileMap.get(Integer.valueOf(ackLocation.getDataFileId())); + Set referenceFileIds = metadata.ackMessageFileMap.get(ackLocation.getDataFileId()); if (referenceFileIds == null) { referenceFileIds = new HashSet<>(); referenceFileIds.add(messageLocation.getDataFileId()); @@ -1690,7 +1690,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe metadata.ackMessageFileMapDirtyFlag.lazySet(true); } else { - Integer id = Integer.valueOf(messageLocation.getDataFileId()); + Integer id = messageLocation.getDataFileId(); if (!referenceFileIds.contains(id)) { referenceFileIds.add(id); } @@ -3869,13 +3869,13 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe void setBatch(Transaction tx, Long sequence) throws IOException { if (sequence != null) { - Long nextPosition = Long.valueOf(sequence.longValue() + 1); + Long nextPosition = sequence + 1; lastDefaultKey = sequence; - cursor.defaultCursorPosition = nextPosition.longValue(); + cursor.defaultCursorPosition = nextPosition; lastHighKey = sequence; - cursor.highPriorityCursorPosition = nextPosition.longValue(); + cursor.highPriorityCursorPosition = nextPosition; lastLowKey = sequence; - cursor.lowPriorityCursorPosition = nextPosition.longValue(); + cursor.lowPriorityCursorPosition = nextPosition; } } @@ -3904,13 +3904,13 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe void stoppedIterating() { if (lastDefaultKey!=null) { - cursor.defaultCursorPosition=lastDefaultKey.longValue()+1; + cursor.defaultCursorPosition= lastDefaultKey +1; } if (lastHighKey!=null) { - cursor.highPriorityCursorPosition=lastHighKey.longValue()+1; + cursor.highPriorityCursorPosition= lastHighKey +1; } if (lastLowKey!=null) { - cursor.lowPriorityCursorPosition=lastLowKey.longValue()+1; + cursor.lowPriorityCursorPosition= lastLowKey +1; } lastDefaultKey = null; lastHighKey = null; diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFile.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFile.java index 1532f08661..4f8a828aa6 100644 --- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFile.java +++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/journal/DataFile.java @@ -40,7 +40,7 @@ public class DataFile extends LinkedNode implements Comparable= 0) { LOG.trace("reached limit: {} at: {}", limit, cur); @@ -1045,7 +1045,7 @@ public class Journal { public DataFile getDataFileById(int dataFileId) { synchronized (currentDataFile) { - return fileMap.get(Integer.valueOf(dataFileId)); + return fileMap.get(dataFileId); } } diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java index 3e535d52b8..e709b66a45 100644 --- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java +++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerImpl.java @@ -195,7 +195,7 @@ public class JobSchedulerImpl extends ServiceSupport implements Runnable, JobSch Iterator>> iter = index.iterator(tx, start); while (iter.hasNext()) { Map.Entry> next = iter.next(); - if (next != null && next.getKey().longValue() <= finish) { + if (next != null && next.getKey() <= finish) { for (JobLocation jl : next.getValue()) { ByteSequence bs = getPayload(jl.getLocation()); Job job = new JobImpl(jl, bs); @@ -565,7 +565,7 @@ public class JobSchedulerImpl extends ServiceSupport implements Runnable, JobSch List keys = new ArrayList<>(); for (Iterator>> i = this.index.iterator(tx, start); i.hasNext();) { Map.Entry> entry = i.next(); - if (entry.getKey().longValue() <= finish) { + if (entry.getKey() <= finish) { keys.add(entry.getKey()); } else { break; diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java index de9fe0c404..37b9566faf 100644 --- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java +++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/JobSchedulerStoreImpl.java @@ -460,7 +460,7 @@ public class JobSchedulerStoreImpl extends AbstractKahaDBStore implements JobSch protected void incrementJournalCount(Transaction tx, Location location) throws IOException { int logId = location.getDataFileId(); Integer val = metaData.getJournalRC().get(tx, logId); - int refCount = val != null ? val.intValue() + 1 : 1; + int refCount = val != null ? val + 1 : 1; metaData.getJournalRC().put(tx, logId, refCount); } diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/legacy/LegacyJobSchedulerImpl.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/legacy/LegacyJobSchedulerImpl.java index 687ffd701e..08153708e0 100644 --- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/legacy/LegacyJobSchedulerImpl.java +++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/scheduler/legacy/LegacyJobSchedulerImpl.java @@ -142,7 +142,7 @@ final class LegacyJobSchedulerImpl extends ServiceSupport { Iterator>> iter = index.iterator(store.getPageFile().tx(), start); while (iter.hasNext()) { Map.Entry> next = iter.next(); - if (next != null && next.getKey().longValue() <= finish) { + if (next != null && next.getKey() <= finish) { for (LegacyJobLocation jl : next.getValue()) { ByteSequence bs = getPayload(jl.getLocation()); LegacyJobImpl job = new LegacyJobImpl(jl, bs); diff --git a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java index d12474523a..a54d86c62c 100644 --- a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java +++ b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/JournalCorruptionEofIndexRecoveryTest.java @@ -240,12 +240,12 @@ public class JournalCorruptionEofIndexRecoveryTest { final var appender = new AbstractAppender("testAppender", new AbstractFilter() {}, new MessageLayout(), false, new Property[0]) { @Override public void append(LogEvent event) { - /** + /** * NOTE: As of JDK v11.0.19 RandomAccessFile throws a messageless EOFException when read fails - * + * * throw new EOFException(); */ - if (event != null + if (event != null && event.getLevel() == Level.WARN && event.getMessage() != null && event.getMessage().getFormattedMessage() != null @@ -369,7 +369,7 @@ public class JournalCorruptionEofIndexRecoveryTest { private void corruptLocation(Location toCorrupt) throws IOException { - DataFile dataFile = ((KahaDBPersistenceAdapter) broker.getPersistenceAdapter()).getStore().getJournal().getFileMap().get(Integer.valueOf(toCorrupt.getDataFileId())); + DataFile dataFile = ((KahaDBPersistenceAdapter) broker.getPersistenceAdapter()).getStore().getJournal().getFileMap().get(toCorrupt.getDataFileId()); RecoverableRandomAccessFile randomAccessFile = dataFile.openRandomAccessFile(); diff --git a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/disk/index/ListIndexTest.java b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/disk/index/ListIndexTest.java index 5e7cdcc579..112ca1ead6 100644 --- a/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/disk/index/ListIndexTest.java +++ b/activemq-kahadb-store/src/test/java/org/apache/activemq/store/kahadb/disk/index/ListIndexTest.java @@ -117,7 +117,7 @@ public class ListIndexTest extends IndexTestSupport { tx = pf.tx(); Long value = listIndex.get(tx, key(10)); assertNotNull(value); - listIndex.put(tx, key(10), Long.valueOf(1024)); + listIndex.put(tx, key(10), 1024L); tx.commit(); tx = pf.tx(); @@ -127,7 +127,7 @@ public class ListIndexTest extends IndexTestSupport { tx.commit(); tx = pf.tx(); - value = listIndex.put(tx, key(31), Long.valueOf(2048)); + value = listIndex.put(tx, key(31), 2048L); assertNull(value); assertTrue(listIndex.size() == 31); tx.commit(); @@ -407,7 +407,7 @@ public class ListIndexTest extends IndexTestSupport { for (long i = 0; i < NUM_ADDITIONS; ++i) { final int stringSize = getMessageSize(1, 4096); String val = new String(new byte[stringSize]); - expected.add(Long.valueOf(stringSize)); + expected.add((long) stringSize); test.add(tx, i, val); } tx.commit(); @@ -425,7 +425,7 @@ public class ListIndexTest extends IndexTestSupport { for (long i = 0; i < NUM_ADDITIONS; ++i) { final int stringSize = getMessageSize(1, 4096); String val = new String(new byte[stringSize]); - expected.add(Long.valueOf(stringSize)); + expected.add((long) stringSize); test.addFirst(tx, i+NUM_ADDITIONS, val); } tx.commit(); @@ -443,7 +443,7 @@ public class ListIndexTest extends IndexTestSupport { for (long i = 0; i < NUM_ADDITIONS; ++i) { final int stringSize = getMessageSize(1, 4096); String val = new String(new byte[stringSize]); - expected.add(Long.valueOf(stringSize)); + expected.add((long) stringSize); test.put(tx, i, val); } tx.commit(); diff --git a/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java b/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java index b132fcdec6..c3fa0e9331 100644 --- a/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java +++ b/activemq-mqtt/src/main/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverter.java @@ -432,7 +432,7 @@ public class MQTTProtocolConverter { public void onActiveMQCommand(Command command) throws Exception { if (command.isResponse()) { Response response = (Response) command; - ResponseHandler rh = resposeHandlers.remove(Integer.valueOf(response.getCorrelationId())); + ResponseHandler rh = resposeHandlers.remove(response.getCorrelationId()); if (rh != null) { rh.onResponse(this, response); } else { 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 99d4d9c5ec..663612a306 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 @@ -552,11 +552,11 @@ public class ActiveMQActivationSpec implements MessageActivationSpec, Serializab } public boolean isUseRAManagedTransactionEnabled() { - return Boolean.valueOf(useRAManagedTransaction).booleanValue(); + return Boolean.valueOf(useRAManagedTransaction); } public boolean getNoLocalBooleanValue() { - return Boolean.valueOf(noLocal).booleanValue(); + return Boolean.valueOf(noLocal); } public String getEnableBatch() { @@ -573,7 +573,7 @@ public class ActiveMQActivationSpec implements MessageActivationSpec, Serializab } public boolean getEnableBatchBooleanValue() { - return Boolean.valueOf(enableBatch).booleanValue(); + return Boolean.valueOf(enableBatch); } public int getMaxMessagesPerBatchIntValue() { 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 3f3bc0ae3f..376773cc71 100644 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQConnectionRequestInfo.java @@ -281,27 +281,27 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser } public boolean isUseInboundSessionEnabled() { - return useInboundSession != null && useInboundSession.booleanValue(); + return useInboundSession != null && useInboundSession; } public Double getRedeliveryBackOffMultiplier() { - return Double.valueOf(redeliveryPolicy().getBackOffMultiplier()); + return redeliveryPolicy().getBackOffMultiplier(); } public Long getInitialRedeliveryDelay() { - return Long.valueOf(redeliveryPolicy().getInitialRedeliveryDelay()); + return redeliveryPolicy().getInitialRedeliveryDelay(); } public Long getMaximumRedeliveryDelay() { - return Long.valueOf(redeliveryPolicy().getMaximumRedeliveryDelay()); + return redeliveryPolicy().getMaximumRedeliveryDelay(); } public Integer getMaximumRedeliveries() { - return Integer.valueOf(redeliveryPolicy().getMaximumRedeliveries()); + return redeliveryPolicy().getMaximumRedeliveries(); } public Boolean getRedeliveryUseExponentialBackOff() { - return Boolean.valueOf(redeliveryPolicy().isUseExponentialBackOff()); + return redeliveryPolicy().isUseExponentialBackOff(); } public void setRedeliveryBackOffMultiplier(Double value) { @@ -312,34 +312,34 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser public void setInitialRedeliveryDelay(Long value) { if (value != null) { - redeliveryPolicy().setInitialRedeliveryDelay(value.longValue()); + redeliveryPolicy().setInitialRedeliveryDelay(value); } } public void setMaximumRedeliveryDelay(Long value) { if (value != null) { - redeliveryPolicy().setMaximumRedeliveryDelay(value.longValue()); + redeliveryPolicy().setMaximumRedeliveryDelay(value); } } public void setMaximumRedeliveries(Integer value) { if (value != null) { - redeliveryPolicy().setMaximumRedeliveries(value.intValue()); + redeliveryPolicy().setMaximumRedeliveries(value); } } public void setRedeliveryUseExponentialBackOff(Boolean value) { if (value != null) { - redeliveryPolicy().setUseExponentialBackOff(value.booleanValue()); + redeliveryPolicy().setUseExponentialBackOff(value); } } public Integer getDurableTopicPrefetch() { - return Integer.valueOf(prefetchPolicy().getDurableTopicPrefetch()); + return prefetchPolicy().getDurableTopicPrefetch(); } public Integer getOptimizeDurableTopicPrefetch() { - return Integer.valueOf(prefetchPolicy().getOptimizeDurableTopicPrefetch()); + return prefetchPolicy().getOptimizeDurableTopicPrefetch(); } @Deprecated @@ -348,50 +348,50 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser } public Integer getQueueBrowserPrefetch() { - return Integer.valueOf(prefetchPolicy().getQueueBrowserPrefetch()); + return prefetchPolicy().getQueueBrowserPrefetch(); } public Integer getQueuePrefetch() { - return Integer.valueOf(prefetchPolicy().getQueuePrefetch()); + return prefetchPolicy().getQueuePrefetch(); } public Integer getTopicPrefetch() { - return Integer.valueOf(prefetchPolicy().getTopicPrefetch()); + return prefetchPolicy().getTopicPrefetch(); } public void setAllPrefetchValues(Integer i) { if (i != null) { - prefetchPolicy().setAll(i.intValue()); + prefetchPolicy().setAll(i); } } public void setDurableTopicPrefetch(Integer durableTopicPrefetch) { if (durableTopicPrefetch != null) { - prefetchPolicy().setDurableTopicPrefetch(durableTopicPrefetch.intValue()); + prefetchPolicy().setDurableTopicPrefetch(durableTopicPrefetch); } } public void setOptimizeDurableTopicPrefetch(Integer optimizeDurableTopicPrefetch) { if (optimizeDurableTopicPrefetch != null) { - prefetchPolicy().setOptimizeDurableTopicPrefetch(optimizeDurableTopicPrefetch.intValue()); + prefetchPolicy().setOptimizeDurableTopicPrefetch(optimizeDurableTopicPrefetch); } } public void setQueueBrowserPrefetch(Integer queueBrowserPrefetch) { if (queueBrowserPrefetch != null) { - prefetchPolicy().setQueueBrowserPrefetch(queueBrowserPrefetch.intValue()); + prefetchPolicy().setQueueBrowserPrefetch(queueBrowserPrefetch); } } public void setQueuePrefetch(Integer queuePrefetch) { if (queuePrefetch != null) { - prefetchPolicy().setQueuePrefetch(queuePrefetch.intValue()); + prefetchPolicy().setQueuePrefetch(queuePrefetch); } } public void setTopicPrefetch(Integer topicPrefetch) { if (topicPrefetch != null) { - prefetchPolicy().setTopicPrefetch(topicPrefetch.intValue()); + prefetchPolicy().setTopicPrefetch(topicPrefetch); } } @@ -418,7 +418,7 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser } public boolean isUseSessionArgs() { - return useSessionArgs != null ? useSessionArgs.booleanValue() : false; + return useSessionArgs != null ? useSessionArgs : false; } public Boolean getUseSessionArgs() { diff --git a/activemq-ra/src/test/java/org/apache/activemq/ra/ActiveMQConnectionFactoryTest.java b/activemq-ra/src/test/java/org/apache/activemq/ra/ActiveMQConnectionFactoryTest.java index 4e6e25234f..e4957f7bb1 100644 --- a/activemq-ra/src/test/java/org/apache/activemq/ra/ActiveMQConnectionFactoryTest.java +++ b/activemq-ra/src/test/java/org/apache/activemq/ra/ActiveMQConnectionFactoryTest.java @@ -54,7 +54,7 @@ public class ActiveMQConnectionFactoryTest { info.setServerUrl(url); info.setUserName(user); info.setPassword(pwd); - info.setAllPrefetchValues(new Integer(100)); + info.setAllPrefetchValues(100); } @Test(timeout = 60000) diff --git a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java index 9981452e63..10f0ee351e 100644 --- a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java +++ b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java @@ -174,7 +174,7 @@ public class ProtocolConverter { command.setCommandId(generateCommandId()); if (handler != null) { command.setResponseRequired(true); - resposeHandlers.put(Integer.valueOf(command.getCommandId()), handler); + resposeHandlers.put(command.getCommandId(), handler); } stompTransport.sendToActiveMQ(command); } @@ -863,7 +863,7 @@ public class ProtocolConverter { public void onActiveMQCommand(Command command) throws IOException, JMSException { if (command.isResponse()) { Response response = (Response)command; - ResponseHandler rh = resposeHandlers.remove(Integer.valueOf(response.getCorrelationId())); + ResponseHandler rh = resposeHandlers.remove(response.getCorrelationId()); if (rh != null) { rh.onResponse(this, response); } else { diff --git a/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/JMSMemtest.java b/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/JMSMemtest.java index 1cf2ef1938..255a66f34f 100644 --- a/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/JMSMemtest.java +++ b/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/JMSMemtest.java @@ -84,14 +84,14 @@ public class JMSMemtest { url = settings.getProperty("url"); topic = Boolean.parseBoolean(settings.getProperty("topic")); durable = Boolean.parseBoolean(settings.getProperty("durable")); - connectionCheckpointSize = Integer.valueOf(settings.getProperty("connectionCheckpointSize")).intValue(); - producerCount = Integer.valueOf(settings.getProperty("producerCount")).intValue(); - consumerCount = Integer.valueOf(settings.getProperty("consumerCount")).intValue(); - messageCount = Integer.valueOf(settings.getProperty("messageCount")).intValue(); - messageSize = Integer.valueOf(settings.getProperty("messageSize")).intValue(); - prefetchSize = Integer.valueOf(settings.getProperty("prefetchSize")).intValue(); - checkpointInterval = Integer.valueOf(settings.getProperty("checkpointInterval")).intValue() * 1000; - producerCount = Integer.valueOf(settings.getProperty("producerCount")).intValue(); + connectionCheckpointSize = Integer.valueOf(settings.getProperty("connectionCheckpointSize")); + producerCount = Integer.valueOf(settings.getProperty("producerCount")); + consumerCount = Integer.valueOf(settings.getProperty("consumerCount")); + messageCount = Integer.valueOf(settings.getProperty("messageCount")); + messageSize = Integer.valueOf(settings.getProperty("messageSize")); + prefetchSize = Integer.valueOf(settings.getProperty("prefetchSize")); + checkpointInterval = Integer.valueOf(settings.getProperty("checkpointInterval")) * 1000; + producerCount = Integer.valueOf(settings.getProperty("producerCount")); reportName = settings.getProperty("reportName"); destinationName = settings.getProperty("destinationName"); reportDirectory = settings.getProperty("reportDirectory"); diff --git a/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/MemoryMonitoringTool.java b/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/MemoryMonitoringTool.java index c4aa99abfe..fc2fa633ba 100644 --- a/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/MemoryMonitoringTool.java +++ b/activemq-tooling/activemq-memtest-maven-plugin/src/main/java/org/apache/activemq/tool/MemoryMonitoringTool.java @@ -67,7 +67,7 @@ public class MemoryMonitoringTool implements Runnable { public Thread startMonitor() { String intervalStr = this.getTestSettings().getProperty("checkpoint_interval"); - checkpointInterval = Integer.valueOf(intervalStr).intValue(); + checkpointInterval = Integer.valueOf(intervalStr); this.getTestSettings().remove("checkpoint_interval"); memoryBean = ManagementFactory.getMemoryMXBean(); diff --git a/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java b/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java index fc6d7bbdda..bda4c5f7c0 100644 --- a/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java +++ b/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java @@ -127,7 +127,7 @@ public final class ReflectionUtil { }); } else if (paramType == Character.TYPE) { setterMethod.invoke(target, new Object[] { - new Character(val.charAt(0)) + val.charAt(0) }); } } else { diff --git a/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/reports/PerformanceStatisticsUtil.java b/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/reports/PerformanceStatisticsUtil.java index f5a8661467..ed28ac1013 100644 --- a/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/reports/PerformanceStatisticsUtil.java +++ b/activemq-tooling/activemq-perf-maven-plugin/src/main/java/org/apache/activemq/tool/reports/PerformanceStatisticsUtil.java @@ -27,7 +27,7 @@ public final class PerformanceStatisticsUtil { long sum = 0; if (numList != null) { for (Iterator i = numList.iterator(); i.hasNext();) { - sum += ((Long)i.next()).longValue(); + sum += (Long) i.next(); } } else { sum = -1; @@ -39,7 +39,7 @@ public final class PerformanceStatisticsUtil { long min = Long.MAX_VALUE; if (numList != null) { for (Iterator i = numList.iterator(); i.hasNext();) { - min = Math.min(((Long)i.next()).longValue(), min); + min = Math.min((Long) i.next(), min); } } else { min = -1; @@ -51,7 +51,7 @@ public final class PerformanceStatisticsUtil { long max = Long.MIN_VALUE; if (numList != null) { for (Iterator i = numList.iterator(); i.hasNext();) { - max = Math.max(((Long)i.next()).longValue(), max); + max = Math.max((Long) i.next(), max); } } else { max = -1; @@ -66,7 +66,7 @@ public final class PerformanceStatisticsUtil { long totalTP = 0; for (Iterator i = numList.iterator(); i.hasNext();) { sampleCount++; - totalTP += ((Long)i.next()).longValue(); + totalTP += (Long) i.next(); } return (double)totalTP / (double)sampleCount; } else { @@ -85,7 +85,7 @@ public final class PerformanceStatisticsUtil { long sampleTP; for (Iterator i = numList.iterator(); i.hasNext();) { sampleCount++; - sampleTP = ((Long)i.next()).longValue(); + sampleTP = (Long) i.next(); if (sampleTP != minTP && sampleTP != maxTP) { totalTP += sampleTP; } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java index 0eff63fe1a..9f603bbe0f 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java @@ -77,9 +77,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestMessageListenerWithConsumerCanBeStopped() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testMessageListenerWithConsumerCanBeStopped() throws Exception { @@ -199,11 +199,11 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestMutiReceiveWithPrefetch1() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.AUTO_ACKNOWLEDGE), Integer.valueOf(Session.DUPS_OK_ACKNOWLEDGE), - Integer.valueOf(Session.CLIENT_ACKNOWLEDGE)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("ackMode", new Object[] {Session.AUTO_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, + Session.CLIENT_ACKNOWLEDGE}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testMutiReceiveWithPrefetch1() throws Exception { @@ -322,8 +322,8 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestDurableConsumerSelectorChange() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.TOPIC_TYPE}); } public void testDurableConsumerSelectorChange() throws Exception { @@ -366,9 +366,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestSendReceiveBytesMessage() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testSendReceiveBytesMessage() throws Exception { @@ -395,9 +395,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestSetMessageListenerAfterStart() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testSetMessageListenerAfterStart() throws Exception { @@ -433,7 +433,7 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestPassMessageListenerIntoCreateConsumer() { - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE}); } public void testPassMessageListenerIntoCreateConsumer() throws Exception { @@ -467,9 +467,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestMessageListenerOnMessageCloseUnackedWithPrefetch1StayInQueue() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.CLIENT_ACKNOWLEDGE)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("ackMode", new Object[] {Session.CLIENT_ACKNOWLEDGE}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE}); } public void testMessageListenerOnMessageCloseUnackedWithPrefetch1StayInQueue() throws Exception { @@ -555,9 +555,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestMessageListenerAutoAckOnCloseWithPrefetch1() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.AUTO_ACKNOWLEDGE), Integer.valueOf(Session.CLIENT_ACKNOWLEDGE)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("ackMode", new Object[] {Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE}); } public void testMessageListenerAutoAckOnCloseWithPrefetch1() throws Exception { @@ -642,9 +642,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestMessageListenerWithConsumerWithPrefetch1() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testMessageListenerWithConsumerWithPrefetch1() throws Exception { @@ -680,9 +680,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestMessageListenerWithConsumer() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testMessageListenerWithConsumer() throws Exception { @@ -716,10 +716,10 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestUnackedWithPrefetch1StayInQueue() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.AUTO_ACKNOWLEDGE), Integer.valueOf(Session.DUPS_OK_ACKNOWLEDGE), - Integer.valueOf(Session.CLIENT_ACKNOWLEDGE)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("ackMode", new Object[] {Session.AUTO_ACKNOWLEDGE, Session.DUPS_OK_ACKNOWLEDGE, + Session.CLIENT_ACKNOWLEDGE}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE}); } public void testUnackedWithPrefetch1StayInQueue() throws Exception { @@ -764,7 +764,7 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestPrefetch1MessageNotDispatched() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); } public void testPrefetch1MessageNotDispatched() throws Exception { @@ -806,8 +806,8 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestDontStart() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE}); } public void testDontStart() throws Exception { @@ -824,8 +824,8 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestStartAfterSend() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE}); } public void testStartAfterSend() throws Exception { @@ -846,9 +846,9 @@ public class JMSConsumerTest extends JmsTestSupport { } public void initCombosForTestReceiveMessageWithConsumer() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testReceiveMessageWithConsumer() throws Exception { @@ -990,7 +990,7 @@ public class JMSConsumerTest extends JmsTestSupport { public void initCombosForTestAckOfExpired() { addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE}); } public void testAckOfExpired() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java index eda6faabef..b4a8d0de74 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSExclusiveConsumerTest.java @@ -43,7 +43,7 @@ public class JMSExclusiveConsumerTest extends JmsTestSupport { } public void initCombosForTestRoundRobinDispatchOnNonExclusive() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); } /** @@ -80,7 +80,7 @@ public class JMSExclusiveConsumerTest extends JmsTestSupport { } public void initCombosForTestDispatchExclusive() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); } /** diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java index f4749a1169..1e852000fc 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSMessageTest.java @@ -60,9 +60,9 @@ public class JMSMessageTest extends JmsTestSupport { public void initCombos() { addCombinationValues("connectURL", new Object[] {"vm://localhost?marshal=false", "vm://localhost?marshal=true"}); - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE}); } public void testTextMessage() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSUsecaseTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSUsecaseTest.java index d22907a95a..308a25fa6b 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSUsecaseTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSUsecaseTest.java @@ -49,8 +49,8 @@ public class JMSUsecaseTest extends JmsTestSupport { } public void initCombosForTestQueueBrowser() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TEMP_QUEUE_TYPE}); } public void testQueueBrowser() throws Exception { @@ -77,9 +77,9 @@ public class JMSUsecaseTest extends JmsTestSupport { } public void initCombosForTestSendReceive() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testSendReceive() throws Exception { @@ -99,9 +99,9 @@ public class JMSUsecaseTest extends JmsTestSupport { } public void initCombosForTestSendReceiveTransacted() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testSendReceiveTransacted() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java b/activemq-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java index 4462844bd6..4fcaed46bb 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java @@ -93,14 +93,14 @@ public class LoadTestBurnIn extends JmsTestSupport { } public void initCombosForTestSendReceive() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.TOPIC_TYPE}); addCombinationValues("durableConsumer", new Object[] {Boolean.TRUE}); - addCombinationValues("messageSize", new Object[] {Integer.valueOf(101), Integer.valueOf(102), - Integer.valueOf(103), Integer.valueOf(104), - Integer.valueOf(105), Integer.valueOf(106), - Integer.valueOf(107), Integer.valueOf(108)}); + addCombinationValues("messageSize", new Object[] {101, 102, + 103, 104, + 105, 106, + 107, 108}); } public void testSendReceive() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java index c4b0230c9d..5b7678a723 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java @@ -46,8 +46,8 @@ public class BrokerTest extends BrokerTestSupport { protected static final int MAX_NULL_WAIT=500; public void initCombosForTestQueueOnlyOnceDeliveryWith2Consumers() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); } public void testQueueOnlyOnceDeliveryWith2Consumers() throws Exception { @@ -100,8 +100,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestQueueBrowserWith2Consumers() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); } public void testQueueBrowserWith2Consumers() throws Exception { @@ -287,12 +287,12 @@ public class BrokerTest extends BrokerTestSupport { public void initCombosForTestConsumerPrefetchAndStandardAck() { addCombinationValues("deliveryMode", new Object[] { // Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testConsumerPrefetchAndStandardAck() throws Exception { @@ -338,13 +338,13 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestTransactedAckWithPrefetchOfOne() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testTransactedAckWithPrefetchOfOne() throws Exception { @@ -389,13 +389,13 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestTransactedSend() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testTransactedSend() throws Exception { @@ -443,11 +443,11 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestQueueTransactedAck() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE}); } public void testQueueTransactedAck() throws Exception { @@ -552,8 +552,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestGroupedMessagesDeliveredToOnlyOneConsumer() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); } public void testGroupedMessagesDeliveredToOnlyOneConsumer() throws Exception { @@ -614,8 +614,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestTopicConsumerOnlySeeMessagesAfterCreation() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("durableConsumer", new Object[] {Boolean.TRUE, Boolean.FALSE}); } @@ -659,8 +659,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestTopicRetroactiveConsumerSeeMessagesBeforeCreation() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("durableConsumer", new Object[] {Boolean.TRUE, Boolean.FALSE}); } @@ -809,8 +809,8 @@ public class BrokerTest extends BrokerTestSupport { public void initCombosForTestExclusiveQueueDeliversToOnlyOneConsumer() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); } public void testExclusiveQueueDeliversToOnlyOneConsumer() throws Exception { @@ -874,10 +874,10 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestWildcardConsume() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE}); } public void testWildcardConsume() throws Exception { @@ -925,10 +925,10 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestCompositeConsume() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE}); } public void testCompositeConsume() throws Exception { @@ -969,10 +969,10 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestCompositeSend() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE}); } public void testCompositeSend() throws Exception { @@ -1038,8 +1038,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestConnectionCloseCascades() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destination", new Object[] {new ActiveMQTopic("TEST"), new ActiveMQQueue("TEST")}); } @@ -1094,8 +1094,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestSessionCloseCascades() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destination", new Object[] {new ActiveMQTopic("TEST"), new ActiveMQQueue("TEST")}); } @@ -1147,8 +1147,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestConsumerClose() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destination", new Object[] {new ActiveMQTopic("TEST"), new ActiveMQQueue("TEST")}); } @@ -1205,8 +1205,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestTopicNoLocal() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); } public void testTopicNoLocal() throws Exception { @@ -1271,8 +1271,8 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTopicDispatchIsBroadcast() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); } public void testTopicDispatchIsBroadcast() throws Exception { @@ -1320,11 +1320,11 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestQueueDispatchedAreRedeliveredOnConsumerClose() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE}); } public void testQueueDispatchedAreRedeliveredOnConsumerClose() throws Exception { @@ -1381,11 +1381,11 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestQueueBrowseMessages() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE}); } public void testQueueBrowseMessages() throws Exception { @@ -1421,11 +1421,11 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestQueueSendThenAddConsumer() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE}); } public void testQueueSendThenAddConsumer() throws Exception { @@ -1455,11 +1455,11 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestQueueAckRemovesMessage() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE}); } public void testQueueAckRemovesMessage() throws Exception { @@ -1499,10 +1499,10 @@ public class BrokerTest extends BrokerTestSupport { addCombinationValues("destination", new Object[] {new ActiveMQTopic("TEST_TOPIC"), new ActiveMQQueue("TEST_QUEUE")}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testSelectorSkipsMessages() throws Exception { @@ -1540,13 +1540,13 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestAddConsumerThenSend() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testAddConsumerThenSend() throws Exception { @@ -1573,13 +1573,13 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestConsumerPrefetchAtOne() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testConsumerPrefetchAtOne() throws Exception { @@ -1611,13 +1611,13 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestConsumerPrefetchAtTwo() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testConsumerPrefetchAtTwo() throws Exception { @@ -1652,13 +1652,13 @@ public class BrokerTest extends BrokerTestSupport { } public void initCombosForTestConsumerPrefetchAndDeliveredAck() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); addCombinationValues("destinationType", - new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, + ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testConsumerPrefetchAndDeliveredAck() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java index 5c7f29d257..0edd40d260 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/MessageExpirationTest.java @@ -48,9 +48,9 @@ public class MessageExpirationTest extends BrokerTestSupport { } public void initCombosForTestMessagesWaitingForUssageDecreaseExpire() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE, + ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE}); } @Override @@ -146,9 +146,9 @@ public class MessageExpirationTest extends BrokerTestSupport { } public void initCombosForTestMessagesInLongTransactionExpire() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.PERSISTENT), Integer.valueOf(DeliveryMode.NON_PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.PERSISTENT, DeliveryMode.NON_PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testMessagesInLongTransactionExpire() throws Exception { @@ -210,9 +210,9 @@ public class MessageExpirationTest extends BrokerTestSupport { } public void initCombosForTestMessagesInSubscriptionPendingListExpire() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE), - Byte.valueOf(ActiveMQDestination.TEMP_QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TEMP_TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE, + ActiveMQDestination.TEMP_QUEUE_TYPE, ActiveMQDestination.TEMP_TOPIC_TYPE}); } public void testMessagesInSubscriptionPendingListExpire() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/DestinationRemoveRestartTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/DestinationRemoveRestartTest.java index 06011fe6f7..b525fb49ed 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/DestinationRemoveRestartTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/DestinationRemoveRestartTest.java @@ -47,8 +47,8 @@ public class DestinationRemoveRestartTest extends CombinationTestSupport { } public void initCombosForTestCheckDestinationRemoveActionAfterRestart() { - addCombinationValues("destinationType", new Object[]{Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("destinationType", new Object[]{ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE}); } public void testCheckDestinationRemoveActionAfterRestart() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java index 3c014a6728..a4860a9012 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/region/cursors/CursorSupport.java @@ -87,10 +87,10 @@ public abstract class CursorSupport extends CombinationTestSupport { public void initCombosForTestSendWhilstConsume() { - addCombinationValues("MESSAGE_COUNT", new Object[] {Integer.valueOf(400), - Integer.valueOf(500)}); - addCombinationValues("PREFETCH_SIZE", new Object[] {Integer.valueOf(100), - Integer.valueOf(50)}); + addCombinationValues("MESSAGE_COUNT", new Object[] {400, + 500}); + addCombinationValues("PREFETCH_SIZE", new Object[] {100, + 50}); } public void testSendWhilstConsume() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualDestPerfTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualDestPerfTest.java index 572c4410ee..ba088d93a4 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualDestPerfTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualDestPerfTest.java @@ -91,7 +91,7 @@ public class VirtualDestPerfTest { executor.awaitTermination(5, TimeUnit.MINUTES); long endTime = System.currentTimeMillis(); long seconds = (endTime - startTime) / 1000; - LOG.info("For numThreads {} duration {}", numThreads.intValue(), seconds); + LOG.info("For numThreads {} duration {}", numThreads, seconds); results.put(numThreads, seconds); LOG.info("Broker got {} messages", brokerService.getAdminView().getTotalEnqueueCount()); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java index c2426a19bc..d0f2403c19 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java @@ -46,7 +46,7 @@ public class VirtualTopicPubSubTest extends EmbeddedBrokerTestSupport { } public void initCombosForTestVirtualTopicCreation() { - addCombinationValues("ackMode", new Object[] {Integer.valueOf(Session.AUTO_ACKNOWLEDGE), Integer.valueOf(Session.CLIENT_ACKNOWLEDGE) }); + addCombinationValues("ackMode", new Object[] {Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE}); } private boolean doneTwice = false; diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1282.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1282.java index 9cd240f029..386007b6d9 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1282.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1282.java @@ -53,7 +53,7 @@ public class AMQ1282 extends TestCase { public void testUnmappedBooleanMessage() throws JMSException { Object expected; try { - expected = Boolean.valueOf(null); + expected = (Boolean) null; } catch (Exception ex) { expected = ex; } @@ -68,7 +68,7 @@ public class AMQ1282 extends TestCase { public void testUnmappedIntegerMessage() throws JMSException { Object expected; try { - expected = Integer.valueOf(null); + expected = (Integer) null; } catch (Exception ex) { expected = ex; } @@ -84,7 +84,7 @@ public class AMQ1282 extends TestCase { public void testUnmappedShortMessage() throws JMSException { Object expected; try { - expected = Short.valueOf(null); + expected = (Short) null; } catch (Exception ex) { expected = ex; } @@ -100,7 +100,7 @@ public class AMQ1282 extends TestCase { public void testUnmappedLongMessage() throws JMSException { Object expected; try { - expected = Long.valueOf(null); + expected = (Long) null; } catch (Exception ex) { expected = ex; } @@ -141,7 +141,7 @@ public class AMQ1282 extends TestCase { public void testUnmappedByteMessage() throws JMSException { Object expected; try { - expected = Byte.valueOf(null); + expected = (Byte) null; } catch (Exception ex) { expected = ex; } @@ -157,7 +157,7 @@ public class AMQ1282 extends TestCase { public void testUnmappedDoubleMessage() throws JMSException { Object expected; try { - expected = Double.valueOf(null); + expected = (Double) null; } catch (Exception ex) { expected = ex; } @@ -173,7 +173,7 @@ public class AMQ1282 extends TestCase { public void testUnmappedFloatMessage() throws JMSException { Object expected; try { - expected = Float.valueOf(null); + expected = (Float) null; } catch (Exception ex) { expected = ex; } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4531Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4531Test.java index 0be3226582..cb3de24fa0 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4531Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4531Test.java @@ -132,7 +132,7 @@ public class AMQ4531Test extends TestCase { } private long openFileDescriptorCount() throws Exception { - return ((Long) mbeanServer.getAttribute(new ObjectName("java.lang:type=OperatingSystem"), "OpenFileDescriptorCount")).longValue(); + return (Long) mbeanServer.getAttribute(new ObjectName("java.lang:type=OperatingSystem"), "OpenFileDescriptorCount"); } private String getStack(Throwable aThrowable) { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java index 8979323ad6..7c17e9fb54 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5212Test.java @@ -239,7 +239,7 @@ public class AMQ5212Test { super.send(producerExchange, messageSend); Object seq = messageSend.getProperty("seq"); if (seq instanceof Integer) { - if ( ((Integer) seq).intValue() %200 == 0 && producerExchange.getConnectionContext().getConnection() != null) { + if ((Integer) seq %200 == 0 && producerExchange.getConnectionContext().getConnection() != null) { producerExchange.getConnectionContext().setDontSendReponse(true); producerExchange.getConnectionContext().getConnection().serviceException(new IOException("force reconnect")); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java index 2ed3689209..f3323a7b7a 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java @@ -311,9 +311,9 @@ public class DurableConsumerTest extends CombinationTestSupport{ public void testPrefetchViaBrokerConfig() throws Exception { - Integer prefetchVal = Integer.valueOf(150); + Integer prefetchVal = 150; PolicyEntry policyEntry = new PolicyEntry(); - policyEntry.setDurableTopicPrefetch(prefetchVal.intValue()); + policyEntry.setDurableTopicPrefetch(prefetchVal); policyEntry.setPrioritizedMessages(true); PolicyMap policyMap = new PolicyMap(); policyMap.setDefaultEntry(policyEntry); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java index fe86019be9..c2390bf15d 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java @@ -235,13 +235,13 @@ public class ActiveMQBytesMessageTest extends TestCase { try { msg.writeObject("fred"); msg.writeObject(Boolean.TRUE); - msg.writeObject(Character.valueOf('q')); - msg.writeObject(Byte.valueOf((byte) 1)); - msg.writeObject(Short.valueOf((short) 3)); - msg.writeObject(Integer.valueOf(3)); - msg.writeObject(Long.valueOf(300L)); - msg.writeObject(Float.valueOf(3.3f)); - msg.writeObject(Double.valueOf(3.3)); + msg.writeObject('q'); + msg.writeObject((byte) 1); + msg.writeObject((short) 3); + msg.writeObject(3); + msg.writeObject(300L); + msg.writeObject(3.3f); + msg.writeObject(3.3); msg.writeObject(new byte[3]); } catch (MessageFormatException mfe) { fail("objectified primitives should be allowed"); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java index ddf459c6d9..017b1e0fd1 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java @@ -208,7 +208,7 @@ public class ActiveMQMapMessageTest { Boolean booleanValue = Boolean.TRUE; Byte byteValue = Byte.valueOf("1"); byte[] bytesValue = new byte[3]; - Character charValue = Character.valueOf('a'); + Character charValue = 'a'; Double doubleValue = Double.valueOf("1.5"); Float floatValue = Float.valueOf("1.5"); Integer intValue = Integer.valueOf("1"); @@ -237,7 +237,7 @@ public class ActiveMQMapMessageTest { assertTrue(msg.getObject("boolean") instanceof Boolean); assertEquals(msg.getObject("boolean"), booleanValue); - assertEquals(msg.getBoolean("boolean"), booleanValue.booleanValue()); + assertEquals(msg.getBoolean("boolean"), booleanValue); assertTrue(msg.getObject("byte") instanceof Byte); assertEquals(msg.getObject("byte"), byteValue); assertEquals(msg.getByte("byte"), byteValue.byteValue()); @@ -249,10 +249,10 @@ public class ActiveMQMapMessageTest { assertEquals(msg.getChar("char"), charValue.charValue()); assertTrue(msg.getObject("double") instanceof Double); assertEquals(msg.getObject("double"), doubleValue); - assertEquals(msg.getDouble("double"), doubleValue.doubleValue(), 0); + assertEquals(msg.getDouble("double"), doubleValue, 0); assertTrue(msg.getObject("float") instanceof Float); assertEquals(msg.getObject("float"), floatValue); - assertEquals(msg.getFloat("float"), floatValue.floatValue(), 0); + assertEquals(msg.getFloat("float"), floatValue, 0); assertTrue(msg.getObject("int") instanceof Integer); assertEquals(msg.getObject("int"), intValue); assertEquals(msg.getInt("int"), intValue.intValue()); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java index e1079a1628..c60bd7dcc3 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java @@ -351,7 +351,7 @@ public class ActiveMQMessageTest extends TestCase { String name = "floatProperty"; msg.setFloatProperty(name, 1.3f); assertTrue(msg.getObjectProperty(name) instanceof Float); - assertTrue(((Float) msg.getObjectProperty(name)).floatValue() == 1.3f); + assertTrue((Float) msg.getObjectProperty(name) == 1.3f); } public void testSetJMSDeliveryModeProperty() throws JMSException { @@ -519,8 +519,8 @@ public class ActiveMQMessageTest extends TestCase { assertEquals(((Short) properties.get("shortProperty")).shortValue(), 1); assertEquals(((Integer) properties.get("intProperty")).intValue(), 1); assertEquals(((Long) properties.get("longProperty")).longValue(), 1); - assertEquals(((Float) properties.get("floatProperty")).floatValue(), 1.1f, 0); - assertEquals(((Double) properties.get("doubleProperty")).doubleValue(), 1.1, 0); + assertEquals((Float) properties.get("floatProperty"), 1.1f, 0); + assertEquals((Double) properties.get("doubleProperty"), 1.1, 0); assertEquals(((Boolean) properties.get("booleanProperty")).booleanValue(), true); assertNull(properties.get("nullProperty")); } @@ -751,7 +751,7 @@ public class ActiveMQMessageTest extends TestCase { ActiveMQMessage msg = new ActiveMQMessage(); String propertyName = "property"; msg.setFloatProperty(propertyName, (float) 1.5); - assertEquals(((Float) msg.getObjectProperty(propertyName)).floatValue(), 1.5, 0); + assertEquals((Float) msg.getObjectProperty(propertyName), 1.5, 0); assertEquals(msg.getFloatProperty(propertyName), 1.5, 0); assertEquals(msg.getDoubleProperty(propertyName), 1.5, 0); assertEquals(msg.getStringProperty(propertyName), "1.5"); @@ -786,7 +786,7 @@ public class ActiveMQMessageTest extends TestCase { ActiveMQMessage msg = new ActiveMQMessage(); String propertyName = "property"; msg.setDoubleProperty(propertyName, 1.5); - assertEquals(((Double) msg.getObjectProperty(propertyName)).doubleValue(), 1.5, 0); + assertEquals((Double) msg.getObjectProperty(propertyName), 1.5, 0); assertEquals(msg.getDoubleProperty(propertyName), 1.5, 0); assertEquals(msg.getStringProperty(propertyName), "1.5"); try { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java index c5b60b406d..f57280f880 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java @@ -679,43 +679,43 @@ public class ActiveMQStreamMessageTest { byte testByte = (byte)2; msg.writeByte(testByte); msg.reset(); - assertTrue(((Byte)msg.readObject()).byteValue() == testByte); + assertTrue((Byte) msg.readObject() == testByte); msg.clearBody(); short testShort = 3; msg.writeShort(testShort); msg.reset(); - assertTrue(((Short)msg.readObject()).shortValue() == testShort); + assertTrue((Short) msg.readObject() == testShort); msg.clearBody(); int testInt = 4; msg.writeInt(testInt); msg.reset(); - assertTrue(((Integer)msg.readObject()).intValue() == testInt); + assertTrue((Integer) msg.readObject() == testInt); msg.clearBody(); long testLong = 6L; msg.writeLong(testLong); msg.reset(); - assertTrue(((Long)msg.readObject()).longValue() == testLong); + assertTrue((Long) msg.readObject() == testLong); msg.clearBody(); float testFloat = 6.6f; msg.writeFloat(testFloat); msg.reset(); - assertTrue(((Float)msg.readObject()).floatValue() == testFloat); + assertTrue((Float) msg.readObject() == testFloat); msg.clearBody(); double testDouble = 7.7d; msg.writeDouble(testDouble); msg.reset(); - assertTrue(((Double)msg.readObject()).doubleValue() == testDouble); + assertTrue((Double) msg.readObject() == testDouble); msg.clearBody(); char testChar = 'z'; msg.writeChar(testChar); msg.reset(); - assertTrue(((Character)msg.readObject()).charValue() == testChar); + assertTrue((Character) msg.readObject() == testChar); msg.clearBody(); byte[] data = new byte[50]; @@ -732,7 +732,7 @@ public class ActiveMQStreamMessageTest { msg.clearBody(); msg.writeBoolean(true); msg.reset(); - assertTrue(((Boolean)msg.readObject()).booleanValue()); + assertTrue((Boolean) msg.readObject()); } catch (JMSException jmsEx) { jmsEx.printStackTrace(); assertTrue(false); @@ -743,10 +743,10 @@ public class ActiveMQStreamMessageTest { public void testClearBody() throws JMSException { ActiveMQStreamMessage streamMessage = new ActiveMQStreamMessage(); try { - streamMessage.writeObject(Long.valueOf(2)); + streamMessage.writeObject(2L); streamMessage.clearBody(); assertFalse(streamMessage.isReadOnlyBody()); - streamMessage.writeObject(Long.valueOf(2)); + streamMessage.writeObject(2L); streamMessage.readObject(); fail("should throw exception"); } catch (MessageNotReadableException mnwe) { @@ -967,14 +967,14 @@ public class ActiveMQStreamMessageTest { ActiveMQStreamMessage message = new ActiveMQStreamMessage(); message.clearBody(); message.writeObject("test"); - message.writeObject(Character.valueOf('a')); + message.writeObject('a'); message.writeObject(Boolean.FALSE); - message.writeObject(Byte.valueOf((byte) 2)); - message.writeObject(Short.valueOf((short) 2)); - message.writeObject(Integer.valueOf(2)); - message.writeObject(Long.valueOf(2l)); - message.writeObject(Float.valueOf(2.0f)); - message.writeObject(Double.valueOf(2.0d)); + message.writeObject((byte) 2); + message.writeObject((short) 2); + message.writeObject(2); + message.writeObject(2L); + message.writeObject(2.0f); + message.writeObject(2.0d); } catch(Exception e) { fail(e.getMessage()); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java b/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java index d8c3ec3907..4fe500a75f 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java @@ -76,7 +76,7 @@ public final class SimpleProducer { destinationName = args[0]; LOG.info("Destination name is " + destinationName); if (args.length == 2) { - numMsgs = (Integer.valueOf(args[1])).intValue(); + numMsgs = new Integer(args[1]); } else { numMsgs = 1; } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java b/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java index bce65a1655..df90390456 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java @@ -74,7 +74,7 @@ public final class SimpleQueueSender { queueName = args[0]; LOG.info("Queue name is " + queueName); if (args.length == 2) { - numMsgs = (Integer.valueOf(args[1])).intValue(); + numMsgs = (Integer.valueOf(args[1])); } else { numMsgs = 1; } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactoryTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactoryTest.java index f9ce5b1903..95d67c001c 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactoryTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/jndi/ActiveMQWASInitialContextFactoryTest.java @@ -28,7 +28,7 @@ public class ActiveMQWASInitialContextFactoryTest extends JNDITestSupport { originalEnvironment.put("java.naming.connectionFactoryNames", "ConnectionFactory"); originalEnvironment.put("java.naming.topic.jms.systemMessageTopic", "jms/systemMessageTopic"); originalEnvironment.put(Context.PROVIDER_URL, "tcp://localhost:61616;tcp://localhost:61617"); - originalEnvironment.put("non-string", Integer.valueOf(43)); + originalEnvironment.put("non-string", 43); originalEnvironment.put("java.naming.queue", "jms/systemMessageQueue"); Hashtable transformedEnvironment = new ActiveMQWASInitialContextFactory().transformEnvironment(originalEnvironment); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java index 363b7eb240..257a1a1190 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/network/DemandForwardingBridgeTest.java @@ -39,8 +39,8 @@ public class DemandForwardingBridgeTest extends NetworkTestSupport { private DemandForwardingBridge bridge; public void initCombosForTestSendThenAddConsumer() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE}); } public void testSendThenAddConsumer() throws Exception { @@ -116,8 +116,8 @@ public class DemandForwardingBridgeTest extends NetworkTestSupport { } public void initCombosForTestAddConsumerThenSend() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, ActiveMQDestination.TOPIC_TYPE}); } public void testAddConsumerThenSend() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/network/ForwardingBridgeTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/network/ForwardingBridgeTest.java index 53c4e1d180..f713ce98f0 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/network/ForwardingBridgeTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/network/ForwardingBridgeTest.java @@ -37,10 +37,10 @@ public class ForwardingBridgeTest extends NetworkTestSupport { private ForwardingBridge bridge; public void initCombosForTestForwardMessageCompressed() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE}); } public void testForwardMessageCompressed() throws Exception { @@ -87,10 +87,10 @@ public class ForwardingBridgeTest extends NetworkTestSupport { } public void initCombosForTestAddConsumerThenSend() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), - Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), - Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, + DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.QUEUE_TYPE, + ActiveMQDestination.TOPIC_TYPE}); } public void testAddConsumerThenSend() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/proxy/ProxyConnectorTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/proxy/ProxyConnectorTest.java index bf14a05bf2..8b9a4547ae 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/proxy/ProxyConnectorTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/proxy/ProxyConnectorTest.java @@ -47,8 +47,8 @@ public class ProxyConnectorTest extends ProxyTestSupport { } public void initCombosForTestSendAndConsume() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); - addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); + addCombinationValues("destinationType", new Object[] {ActiveMQDestination.TOPIC_TYPE}); } public void testSendAndConsume() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/store/MessagePriorityTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/store/MessagePriorityTest.java index 9e5199cadf..53330ff3cd 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/store/MessagePriorityTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/store/MessagePriorityTest.java @@ -200,7 +200,7 @@ abstract public class MessagePriorityTest extends CombinationTestSupport { public void initCombosForTestQueues() { addCombinationValues("useCache", new Object[] {Boolean.TRUE, Boolean.FALSE}); - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); } public void testQueues() throws Exception { @@ -232,7 +232,7 @@ abstract public class MessagePriorityTest extends CombinationTestSupport { } public void initCombosForTestDurableSubs() { - addCombinationValues("prefetchVal", new Object[] {Integer.valueOf(1000), Integer.valueOf(MSG_NUM/4)}); + addCombinationValues("prefetchVal", new Object[] {1000, MSG_NUM / 4}); } public void testDurableSubs() throws Exception { @@ -281,7 +281,7 @@ abstract public class MessagePriorityTest extends CombinationTestSupport { } public void initCombosForTestDurableSubsReconnect() { - addCombinationValues("prefetchVal", new Object[] {Integer.valueOf(1000), Integer.valueOf(MSG_NUM/2)}); + addCombinationValues("prefetchVal", new Object[] {1000, MSG_NUM / 2}); // REVISIT = is dispatchAsync = true a problem or is it just the test? addCombinationValues("dispatchAsync", new Object[] {Boolean.FALSE}); addCombinationValues("useCache", new Object[] {Boolean.TRUE, Boolean.FALSE}); @@ -571,7 +571,7 @@ abstract public class MessagePriorityTest extends CombinationTestSupport { addCombinationValues("useCache", new Object[] {Boolean.FALSE}); // expiry processing can fill the cursor with a snapshot of the producer // priority, before producers are complete - addCombinationValues("expireMessagePeriod", new Object[] {Integer.valueOf(0)}); + addCombinationValues("expireMessagePeriod", new Object[] {0}); } public void testQueueBacklog() throws Exception { @@ -611,7 +611,7 @@ abstract public class MessagePriorityTest extends CombinationTestSupport { addCombinationValues("useCache", new Object[] {Boolean.FALSE}); // expiry processing can fill the cursor with a snapshot of the producer // priority, before producers are complete - addCombinationValues("expireMessagePeriod", new Object[] {Integer.valueOf(0)}); + addCombinationValues("expireMessagePeriod", new Object[] {0}); } public void testLowThenHighBatch() throws Exception { @@ -724,7 +724,7 @@ abstract public class MessagePriorityTest extends CombinationTestSupport { addCombinationValues("useCache", new Object[] {Boolean.FALSE, Boolean.TRUE}); // expiry processing can fill the cursor with a snapshot of the producer // priority, before producers are complete - addCombinationValues("expireMessagePeriod", new Object[] {Integer.valueOf(0)}); + addCombinationValues("expireMessagePeriod", new Object[] {0}); } public void testEveryXHi() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java index c120334d2a..a5169e3a06 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java @@ -168,7 +168,7 @@ public class JDBCMessagePriorityTest extends MessagePriorityTest { } public void initCombosForTestConcurrentRate() { - addCombinationValues("prefetchVal", new Object[]{Integer.valueOf(1), Integer.valueOf(500)}); + addCombinationValues("prefetchVal", new Object[]{1, 500}); } public void testConcurrentRate() throws Exception { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java index 09d8cf25bd..034ebe1650 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapAndListPropertyTest.java @@ -45,8 +45,8 @@ public class NestedMapAndListPropertyTest extends JmsTopicSendReceiveWithTwoConn Map map = (Map)message.getObjectProperty("mapField"); assertNotNull(map); assertEquals("mapField.a", "foo", map.get("a")); - assertEquals("mapField.b", Integer.valueOf(23), map.get("b")); - assertEquals("mapField.c", Long.valueOf(45), map.get("c")); + assertEquals("mapField.b", 23, map.get("b")); + assertEquals("mapField.c", 45L, map.get("c")); value = map.get("d"); assertTrue("mapField.d should be a Map", value instanceof Map); @@ -82,8 +82,8 @@ public class NestedMapAndListPropertyTest extends JmsTopicSendReceiveWithTwoConn Map nestedMap = new HashMap(); nestedMap.put("a", "foo"); - nestedMap.put("b", Integer.valueOf(23)); - nestedMap.put("c", Long.valueOf(45)); + nestedMap.put("b", 23); + nestedMap.put("c", 45L); nestedMap.put("d", grandChildMap); answer.setObjectProperty("mapField", nestedMap); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java index f0131ce068..cacfb04018 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java @@ -49,8 +49,8 @@ public class NestedMapMessageTest extends JmsTopicSendReceiveWithTwoConnectionsA Map map = (Map)mapMessage.getObject("mapField"); assertNotNull(map); assertEquals("mapField.a", "foo", map.get("a")); - assertEquals("mapField.b", Integer.valueOf(23), map.get("b")); - assertEquals("mapField.c", Long.valueOf(45), map.get("c")); + assertEquals("mapField.b", 23, map.get("b")); + assertEquals("mapField.c", 45L, map.get("c")); value = map.get("d"); assertTrue("mapField.d should be a Map", value instanceof Map); @@ -85,8 +85,8 @@ public class NestedMapMessageTest extends JmsTopicSendReceiveWithTwoConnectionsA Map nestedMap = new HashMap(); nestedMap.put("a", "foo"); - nestedMap.put("b", Integer.valueOf(23)); - nestedMap.put("c", Long.valueOf(45)); + nestedMap.put("b", 23); + nestedMap.put("c", 45L); nestedMap.put("d", grandChildMap); answer.setObject("mapField", nestedMap); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java index 575b594b4a..3987199b7f 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java @@ -49,7 +49,7 @@ public class FailoverTransportBrokerTest extends NetworkTestSupport { public int deliveryMode; public void initCombosForTestPublisherFailsOver() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST")}); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java index f8236f51f9..aba5337c06 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java @@ -56,7 +56,7 @@ public class FanoutTransportBrokerTest extends NetworkTestSupport { } public void initCombosForTestPublisherFansout() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); addCombinationValues("destination", new Object[] {new ActiveMQTopic("TEST"), new ActiveMQQueue("TEST")}); } @@ -102,7 +102,7 @@ public class FanoutTransportBrokerTest extends NetworkTestSupport { } public void initCombosForTestPublisherWaitsForServerToBeUp() { - addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)}); + addCombinationValues("deliveryMode", new Object[] {DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT}); addCombinationValues("destination", new Object[] {new ActiveMQTopic("TEST")}); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java index 5c1f4847b0..4e5415a91d 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java @@ -246,8 +246,8 @@ public class InactivityMonitorTest extends CombinationTestSupport implements Tra */ public void initCombosForTestNoClientHangWithServerBlock() throws Exception { - addCombinationValues("clientInactivityLimit", new Object[] {Long.valueOf(1000)}); - addCombinationValues("serverInactivityLimit", new Object[] {Long.valueOf(1000)}); + addCombinationValues("clientInactivityLimit", new Object[] {1000L}); + addCombinationValues("serverInactivityLimit", new Object[] {1000L}); addCombinationValues("serverRunOnCommand", new Object[] {new Runnable() { @Override public void run() { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java index c716ee98dc..e34d6114a9 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SocketTstFactory.java @@ -68,14 +68,14 @@ public class SocketTstFactory extends SocketFactory { if (lastDelay == null) { lastDelayVal = 0; } else { - lastDelayVal = lastDelay.intValue(); + lastDelayVal = lastDelay; if (lastDelayVal > 10) lastDelayVal += 20; else lastDelayVal += 1; } - lastDelay = Integer.valueOf(lastDelayVal); + lastDelay = lastDelayVal; LOG.info("Trying to close client socket " + socket.toString() + " in " + lastDelayVal + " milliseconds"); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java index 0f7cd2bd2d..851cd941cf 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java @@ -57,7 +57,7 @@ public class ChangeSentMessageTest extends TestSupport { HashMap map = new HashMap(); ObjectMessage message = publisherSession.createObjectMessage(); for (int i = 0; i < COUNT; i++) { - map.put(VALUE_NAME, Integer.valueOf(i)); + map.put(VALUE_NAME, i); message.setObject(map); producer.send(message); assertTrue(message.getObject() == map); @@ -66,7 +66,7 @@ public class ChangeSentMessageTest extends TestSupport { ObjectMessage msg = (ObjectMessage)consumer.receive(); HashMap receivedMap = (HashMap)msg.getObject(); Integer intValue = (Integer)receivedMap.get(VALUE_NAME); - assertTrue(intValue.intValue() == i); + assertTrue(intValue == i); } } } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberNonPersistentMessageTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberNonPersistentMessageTest.java index 74f6664dec..34fbad7826 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberNonPersistentMessageTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberNonPersistentMessageTest.java @@ -150,7 +150,7 @@ public class DurableSubscriberNonPersistentMessageTest extends TestCase { public boolean isSatisified() throws Exception { Integer pendingQueueSize = (Integer) mbeanServer.getAttribute(new ObjectName(theJmxObject), "PendingQueueSize"); LOG.info("pendingQueueSize = " + pendingQueueSize); - return pendingQueueSize.intValue() == 0; + return pendingQueueSize == 0; } })); @@ -159,7 +159,7 @@ public class DurableSubscriberNonPersistentMessageTest extends TestCase { public boolean isSatisified() throws Exception { Long cursorMemoryUsage = (Long) mbeanServer.getAttribute(new ObjectName(theJmxObject), "CursorMemoryUsage"); LOG.info("cursorMemoryUsage = " + cursorMemoryUsage); - return cursorMemoryUsage.longValue() == 0L; + return cursorMemoryUsage == 0L; } })); diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline1Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline1Test.java index 7c1ec1d314..ca59aefc64 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline1Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline1Test.java @@ -64,7 +64,7 @@ public class DurableSubscriptionOffline1Test extends DurableSubscriptionOfflineT public DurableSubscriptionOffline1Test(PersistenceAdapterChoice adapter, Boolean usePrioritySupport) { this.defaultPersistenceAdapter = adapter; - this.usePrioritySupport = usePrioritySupport.booleanValue(); + this.usePrioritySupport = usePrioritySupport; LOG.debug(">>>> Created with adapter {} usePrioritySupport? {}", defaultPersistenceAdapter, usePrioritySupport); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline2Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline2Test.java index f288340802..a65fd0f0ca 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline2Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline2Test.java @@ -55,7 +55,7 @@ public class DurableSubscriptionOffline2Test extends DurableSubscriptionOfflineT } public DurableSubscriptionOffline2Test(Boolean keepDurableSubsActive) { - this.keepDurableSubsActive = keepDurableSubsActive.booleanValue(); + this.keepDurableSubsActive = keepDurableSubsActive; LOG.info(">>>> running {} with keepDurableSubsActive: {}", testName.getMethodName(), this.keepDurableSubsActive); } diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline4Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline4Test.java index 09c50d0107..e52430cfa1 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline4Test.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriptionOffline4Test.java @@ -54,7 +54,7 @@ public class DurableSubscriptionOffline4Test extends DurableSubscriptionOfflineT public DurableSubscriptionOffline4Test(Boolean keepDurableSubsActive) { this.journalMaxFileLength = 64 * 1024; - this.keepDurableSubsActive = keepDurableSubsActive.booleanValue(); + this.keepDurableSubsActive = keepDurableSubsActive; LOG.info(">>>> running {} with keepDurableSubsActive: {}, journalMaxFileLength", testName.getMethodName(), this.keepDurableSubsActive, journalMaxFileLength); } diff --git a/activemq-web/src/main/java/org/apache/activemq/web/JobFacade.java b/activemq-web/src/main/java/org/apache/activemq/web/JobFacade.java index a7b429fab0..ce71a0814c 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/JobFacade.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/JobFacade.java @@ -38,23 +38,23 @@ public class JobFacade { public long getDelay() { Long result = (Long) data.get("delay"); if (result != null) { - return result.longValue(); + return result; } - return 0l; + return 0L; } public long getPeriod() { Long result = (Long) data.get("period"); if (result != null) { - return result.longValue(); + return result; } - return 0l; + return 0L; } public int getRepeat() { Integer result = (Integer) data.get("repeat"); if (result != null) { - return result.intValue(); + return result; } return 0; } diff --git a/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java b/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java index b40b50f22f..a696c20d7d 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/MessageServlet.java @@ -405,9 +405,9 @@ public class MessageServlet extends MessageServletSupport { timeout = maximumReadTimeout; } - answer = Long.valueOf(System.currentTimeMillis() + timeout); + answer = System.currentTimeMillis() + timeout; } - return answer.longValue(); + return answer; } /** diff --git a/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java b/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java index 5a2771b006..f21b2d52c3 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/MessageServletSupport.java @@ -134,7 +134,7 @@ public abstract class MessageServletSupport extends HttpServlet { } Long expiration = asLong(parameters.remove("JMSExpiration")); if (expiration != null) { - message.setJMSExpiration(expiration.longValue()); + message.setJMSExpiration(expiration); } Destination replyTo = asDestination(parameters.remove("JMSReplyTo")); if (replyTo != null) { diff --git a/activemq-web/src/main/java/org/apache/activemq/web/PortfolioPublishServlet.java b/activemq-web/src/main/java/org/apache/activemq/web/PortfolioPublishServlet.java index 6ad9f011a3..3002a638ff 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/PortfolioPublishServlet.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/PortfolioPublishServlet.java @@ -51,11 +51,11 @@ public class PortfolioPublishServlet extends MessageServletSupport { } else { Integer total = (Integer)request.getSession(true).getAttribute("total"); if (total == null) { - total = Integer.valueOf(0); + total = 0; } int count = getNumberOfMessages(request); - total = Integer.valueOf(total.intValue() + count); + total = total + count; request.getSession().setAttribute("total", total); try { @@ -102,14 +102,14 @@ public class PortfolioPublishServlet extends MessageServletSupport { protected String createStockText(String stock) { Double value = LAST_PRICES.get(stock); if (value == null) { - value = Double.valueOf(Math.random() * 100); + value = Math.random() * 100; } // lets mutate the value by some percentage - double oldPrice = value.doubleValue(); - value = Double.valueOf(mutatePrice(oldPrice)); + double oldPrice = value; + value = mutatePrice(oldPrice); LAST_PRICES.put(stock, value); - double price = value.doubleValue(); + double price = value; double offer = price * 1.001; diff --git a/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java b/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java index c04df936c8..cab37d130b 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java @@ -289,13 +289,13 @@ public class WebClient implements HttpSessionActivationListener, HttpSessionBind // Set prefetch policy for factory if (servletContext.getInitParameter(CONNECTION_FACTORY_PREFETCH_PARAM) != null) { - int prefetch = Integer.valueOf(getInitParameter(servletContext, CONNECTION_FACTORY_PREFETCH_PARAM)).intValue(); + int prefetch = Integer.valueOf(getInitParameter(servletContext, CONNECTION_FACTORY_PREFETCH_PARAM)); amqfactory.getPrefetchPolicy().setAll(prefetch); } // Set optimize acknowledge setting if (servletContext.getInitParameter(CONNECTION_FACTORY_OPTIMIZE_ACK_PARAM) != null) { - boolean optimizeAck = Boolean.valueOf(getInitParameter(servletContext, CONNECTION_FACTORY_OPTIMIZE_ACK_PARAM)).booleanValue(); + boolean optimizeAck = Boolean.valueOf(getInitParameter(servletContext, CONNECTION_FACTORY_OPTIMIZE_ACK_PARAM)); amqfactory.setOptimizeAcknowledge(optimizeAck); }