Remove unnecessary boxing / unboxing

This commit is contained in:
sigee 2017-05-29 16:42:43 +02:00 committed by Sigee
parent 673f4b33e8
commit 3ba93ed957
111 changed files with 653 additions and 654 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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();
}
});
}

View File

@ -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);

View File

@ -112,6 +112,6 @@ public final class BrokerFactory {
if( value==null ) {
return true;
}
return value.booleanValue();
return value;
}
}

View File

@ -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

View File

@ -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<String, Object> 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;
}
}

View File

@ -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;

View File

@ -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..

View File

@ -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;

View File

@ -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;
}

View File

@ -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<GroupPrincipal> getTempDestinationAdminACLs() {

View File

@ -185,7 +185,7 @@ public class CronParser {
static void validate(final CronEntry entry) throws MessageFormatException {
List<Integer> 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<Integer> 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<Integer> list = calculateValues(ce);
for (Integer i : list) {
if (i.intValue() % denominator == 0) {
if (i % denominator == 0) {
result.add(i);
}
}

View File

@ -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[]) {

View File

@ -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);
}
/**

View File

@ -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

View File

@ -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());
}

View File

@ -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);
}
/**

View File

@ -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) {

View File

@ -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;
}

View File

@ -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 {

View File

@ -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);

View File

@ -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) {

View File

@ -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();
}
});
}

View File

@ -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 {

View File

@ -88,6 +88,6 @@ public class inListFunction implements FilterFunction {
cur++;
}
return Boolean.valueOf(found_f);
return found_f;
}
}

View File

@ -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();
}
}

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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);

View File

@ -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

View File

@ -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.

View File

@ -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);
}

View File

@ -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);

View File

@ -596,17 +596,17 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
countIncremented = true;
HashMap<String, Object> options = new HashMap<String, Object>();
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);

View File

@ -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()];

View File

@ -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() {

View File

@ -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);

View File

@ -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);

View File

@ -29,7 +29,7 @@ public class LRUCacheTest {
public void testResize() throws Exception {
LRUCache<Long, Long> underTest = new LRUCache<Long, Long>(1000);
Long count = Long.valueOf(0);
Long count = 0L;
long max = 0;
for (; count < 27276827; count++) {
long start = System.currentTimeMillis();

View File

@ -129,7 +129,7 @@ public class ShutdownCommand extends AbstractJmxCommand {
try {
jmxConnection.invoke(brokerObjName, "terminateJVM", new Object[] {
Integer.valueOf(0)
0
}, new String[] {
"int"
});

View File

@ -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;
}

View File

@ -187,7 +187,7 @@ public class HttpJMSMessagesWithCompressionTest {
@Test
public void testObjectMessage() throws Exception {
executeTest(new MessageCommand<ObjectMessage>() {
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<StreamMessage>() {
private Long value = Long.valueOf(1013);
private Long value = 1013L;
public StreamMessage createMessage(Session session) throws JMSException {
StreamMessage message = session.createStreamMessage();

View File

@ -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));

View File

@ -1682,7 +1682,7 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
}
private void recordAckMessageReferenceLocation(Location ackLocation, Location messageLocation) {
Set<Integer> referenceFileIds = metadata.ackMessageFileMap.get(Integer.valueOf(ackLocation.getDataFileId()));
Set<Integer> 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;

View File

@ -40,7 +40,7 @@ public class DataFile extends LinkedNode<DataFile> implements Comparable<DataFil
DataFile(File file, int number) {
this.file = file;
this.dataFileId = Integer.valueOf(number);
this.dataFileId = number;
length = (int)(file.exists() ? file.length() : 0);
}

View File

@ -718,7 +718,7 @@ public class Journal {
}
DataFile getDataFile(Location item) throws IOException {
Integer key = Integer.valueOf(item.getDataFileId());
Integer key = item.getDataFileId();
DataFile dataFile = null;
synchronized (currentDataFile) {
dataFile = fileMap.get(key);
@ -906,7 +906,7 @@ public class Journal {
if (dataFile == null) {
return null;
} else {
cur.setDataFileId(dataFile.getDataFileId().intValue());
cur.setDataFileId(dataFile.getDataFileId());
cur.setOffset(0);
if (limit != null && cur.compareTo(limit) >= 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);
}
}

View File

@ -195,7 +195,7 @@ public class JobSchedulerImpl extends ServiceSupport implements Runnable, JobSch
Iterator<Map.Entry<Long, List<JobLocation>>> iter = index.iterator(tx, start);
while (iter.hasNext()) {
Map.Entry<Long, List<JobLocation>> 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<Long> keys = new ArrayList<>();
for (Iterator<Map.Entry<Long, List<JobLocation>>> i = this.index.iterator(tx, start); i.hasNext();) {
Map.Entry<Long, List<JobLocation>> entry = i.next();
if (entry.getKey().longValue() <= finish) {
if (entry.getKey() <= finish) {
keys.add(entry.getKey());
} else {
break;

View File

@ -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);
}

View File

@ -142,7 +142,7 @@ final class LegacyJobSchedulerImpl extends ServiceSupport {
Iterator<Map.Entry<Long, List<LegacyJobLocation>>> iter = index.iterator(store.getPageFile().tx(), start);
while (iter.hasNext()) {
Map.Entry<Long, List<LegacyJobLocation>> 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);

View File

@ -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();

View File

@ -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();

View File

@ -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 {

View File

@ -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() {

View File

@ -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() {

View File

@ -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)

View File

@ -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 {

View File

@ -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");

View File

@ -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();

View File

@ -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 {

View File

@ -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;
}

View File

@ -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 {

View File

@ -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});
}
/**

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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());
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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) {

View File

@ -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"));
}

View File

@ -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);

View File

@ -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");

View File

@ -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());

View File

@ -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 {

View File

@ -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());
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<Object, Object> transformedEnvironment = new ActiveMQWASInitialContextFactory().transformEnvironment(originalEnvironment);

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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<String, Object> nestedMap = new HashMap<String, Object>();
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);

View File

@ -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<String, Object> nestedMap = new HashMap<String, Object>();
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);

View File

@ -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")});
}

View File

@ -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")});
}

View File

@ -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() {

Some files were not shown because too many files have changed in this diff Show More