ARTEMIS-4740 reduce unnecessary boxing

This commit is contained in:
Justin Bertram 2024-04-22 14:43:50 -05:00
parent 659b17c3a9
commit fc6f0ee9ec
70 changed files with 264 additions and 264 deletions

View File

@ -331,7 +331,7 @@ public class PrintData extends DBOption {
out.print(" (ACK)"); out.print(" (ACK)");
} }
if (cursorACKs.getCompletePages(q[i]).contains(Long.valueOf(pgid))) { if (cursorACKs.getCompletePages(q[i]).contains(pgid)) {
acked = true; acked = true;
out.print(" (PG-COMPLETE)"); out.print(" (PG-COMPLETE)");
} }
@ -398,8 +398,8 @@ public class PrintData extends DBOption {
CursorAckRecordEncoding encoding = new CursorAckRecordEncoding(); CursorAckRecordEncoding encoding = new CursorAckRecordEncoding();
encoding.decode(buff); encoding.decode(buff);
Long queueID = Long.valueOf(encoding.queueID); Long queueID = encoding.queueID;
Long pageNR = Long.valueOf(encoding.position.getPageNr()); Long pageNR = encoding.position.getPageNr();
if (!cursorInfo.getCompletePages(queueID).add(pageNR)) { if (!cursorInfo.getCompletePages(queueID).add(pageNR)) {
System.err.println("Page " + pageNR + " has been already set as complete on queue " + queueID); System.err.println("Page " + pageNR + " has been already set as complete on queue " + queueID);

View File

@ -194,7 +194,7 @@ public class ServerUtil {
ClientSession session = ((ActiveMQConnection) connection).getInitialSession(); ClientSession session = ((ActiveMQConnection) connection).getInitialSession();
TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration(); TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
String port = (String) transportConfiguration.getParams().get("port"); String port = (String) transportConfiguration.getParams().get("port");
return Integer.valueOf(port) - 61616; return Integer.parseInt(port) - 61616;
} }
public static Connection getServerConnection(int server, Connection... connections) { public static Connection getServerConnection(int server, Connection... connections) {
@ -202,7 +202,7 @@ public class ServerUtil {
ClientSession session = ((ActiveMQConnection) connection).getInitialSession(); ClientSession session = ((ActiveMQConnection) connection).getInitialSession();
TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration(); TransportConfiguration transportConfiguration = session.getSessionFactory().getConnectorConfiguration();
String port = (String) transportConfiguration.getParams().get("port"); String port = (String) transportConfiguration.getParams().get("port");
if (Integer.valueOf(port) == server + 61616) { if (Integer.parseInt(port) == server + 61616) {
return connection; return connection;
} }
} }

View File

@ -1288,14 +1288,14 @@ public class ArtemisTest extends CliTestBase {
* it will read from the InputStream in the ActionContext. It can't read the password since it's using * it will read from the InputStream in the ActionContext. It can't read the password since it's using
* System.console.readPassword() for that. * System.console.readPassword() for that.
*/ */
assertEquals(Long.valueOf(100), Artemis.internalExecute(false, null, null, null, new String[] {"producer", "--destination", "queue://q1", "--message-count", "100", "--password", "admin"}, context)); assertEquals(100L, Artemis.internalExecute(false, null, null, null, new String[] {"producer", "--destination", "queue://q1", "--message-count", "100", "--password", "admin"}, context));
/* /*
* This is the same as above except it will prompt the user to re-enter both the URL and the username. * This is the same as above except it will prompt the user to re-enter both the URL and the username.
*/ */
in = new ByteArrayInputStream("tcp://localhost:61616\nadmin\n".getBytes()); in = new ByteArrayInputStream("tcp://localhost:61616\nadmin\n".getBytes());
context = new ActionContext(in, System.out, System.err); context = new ActionContext(in, System.out, System.err);
assertEquals(Long.valueOf(100), Artemis.internalExecute(false, null, null, null, new String[] {"producer", "--destination", "queue://q1", "--message-count", "100", "--password", "admin", "--url", "tcp://badhost:11111"}, context)); assertEquals(100L, Artemis.internalExecute(false, null, null, null, new String[] {"producer", "--destination", "queue://q1", "--message-count", "100", "--password", "admin", "--url", "tcp://badhost:11111"}, context));
} finally { } finally {
stopServer(); stopServer();
} }
@ -1380,14 +1380,14 @@ public class ArtemisTest extends CliTestBase {
} }
Artemis.internalExecute("data", "print", "--f"); Artemis.internalExecute("data", "print", "--f");
assertEquals(Long.valueOf(100), Artemis.internalExecute("producer", "--destination", "queue://q1", "--message-count", "100", "--user", "admin", "--password", "admin")); assertEquals(100L, Artemis.internalExecute("producer", "--destination", "queue://q1", "--message-count", "100", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(100), Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin")); assertEquals(100L, Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(10), Artemis.internalExecute("producer", "--destination", "queue://q1", "--text-size", "500", "--message-count", "10", "--user", "admin", "--password", "admin")); assertEquals(10L, Artemis.internalExecute("producer", "--destination", "queue://q1", "--text-size", "500", "--message-count", "10", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(10), Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin")); assertEquals(10L, Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(10), Artemis.internalExecute("producer", "--destination", "queue://q1", "--message-size", "500", "--message-count", "10", "--user", "admin", "--password", "admin")); assertEquals(10L, Artemis.internalExecute("producer", "--destination", "queue://q1", "--message-size", "500", "--message-count", "10", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(10), Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin")); assertEquals(10L, Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(10), Artemis.internalExecute("producer", "--destination", "queue://q1", "--message", "message", "--message-count", "10", "--user", "admin", "--password", "admin")); assertEquals(10L, Artemis.internalExecute("producer", "--destination", "queue://q1", "--message", "message", "--message-count", "10", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(10), Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin")); assertEquals(10L, Artemis.internalExecute("consumer", "--destination", "queue://q1", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:" + acceptorPort); ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:" + acceptorPort);
Connection connection = cf.createConnection("admin", "admin"); Connection connection = cf.createConnection("admin", "admin");
@ -1408,20 +1408,20 @@ public class ArtemisTest extends CliTestBase {
connection.close(); connection.close();
cf.close(); cf.close();
assertEquals(Long.valueOf(1), Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--filter", "fruit='banana'", "--user", "admin", "--password", "admin")); assertEquals(1L, Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--filter", "fruit='banana'", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(100), Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--filter", "fruit='orange'", "--user", "admin", "--password", "admin")); assertEquals(100L, Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--filter", "fruit='orange'", "--user", "admin", "--password", "admin"));
assertEquals(Long.valueOf(101), Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--user", "admin", "--password", "admin")); assertEquals(101L, Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--user", "admin", "--password", "admin"));
// should only receive 10 messages on browse as I'm setting messageCount=10 // should only receive 10 messages on browse as I'm setting messageCount=10
assertEquals(Long.valueOf(10), Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--message-count", "10", "--user", "admin", "--password", "admin")); assertEquals(10L, Artemis.internalExecute("browser", "--destination", "queue://q1", "--txt-size", "50", "--message-count", "10", "--user", "admin", "--password", "admin"));
// Nothing was consumed until here as it was only browsing, check it's receiving again // Nothing was consumed until here as it was only browsing, check it's receiving again
assertEquals(Long.valueOf(1), Artemis.internalExecute("consumer", "--destination", "queue://q1", "--txt-size", "50", "--break-on-null", "--receive-timeout", "100", "--filter", "fruit='banana'", "--user", "admin", "--password", "admin")); assertEquals(1L, Artemis.internalExecute("consumer", "--destination", "queue://q1", "--txt-size", "50", "--break-on-null", "--receive-timeout", "100", "--filter", "fruit='banana'", "--user", "admin", "--password", "admin"));
// Checking it was acked before // Checking it was acked before
assertEquals(Long.valueOf(100), Artemis.internalExecute("consumer", "--destination", "queue://q1", "--txt-size", "50", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin")); assertEquals(100L, Artemis.internalExecute("consumer", "--destination", "queue://q1", "--txt-size", "50", "--break-on-null", "--receive-timeout", "100", "--user", "admin", "--password", "admin"));
//add a simple user //add a simple user
AddUser addCmd = new AddUser(); AddUser addCmd = new AddUser();

View File

@ -262,22 +262,22 @@ public class ByteUtil {
try { try {
Matcher m = ONE.matcher(text); Matcher m = ONE.matcher(text);
if (m.matches()) { if (m.matches()) {
return Long.valueOf(Long.parseLong(m.group(1))); return Long.parseLong(m.group(1));
} }
m = KILO.matcher(text); m = KILO.matcher(text);
if (m.matches()) { if (m.matches()) {
return Long.valueOf(Long.parseLong(m.group(1)) * 1024); return Long.parseLong(m.group(1)) * 1024;
} }
m = MEGA.matcher(text); m = MEGA.matcher(text);
if (m.matches()) { if (m.matches()) {
return Long.valueOf(Long.parseLong(m.group(1)) * 1024 * 1024); return Long.parseLong(m.group(1)) * 1024 * 1024;
} }
m = GIGA.matcher(text); m = GIGA.matcher(text);
if (m.matches()) { if (m.matches()) {
return Long.valueOf(Long.parseLong(m.group(1)) * 1024 * 1024 * 1024); return Long.parseLong(m.group(1)) * 1024 * 1024 * 1024;
} }
return Long.parseLong(text); return Long.parseLong(text);

View File

@ -24,7 +24,7 @@ public class PairTest extends Assert {
@Test @Test
public void testPair() { public void testPair() {
Pair<Integer, Integer> p = new Pair<>(Integer.valueOf(12), Integer.valueOf(13)); Pair<Integer, Integer> p = new Pair<>(12, 13);
int hash = p.hashCode(); int hash = p.hashCode();
p.setA(null); p.setA(null);
assertTrue(hash != p.hashCode()); assertTrue(hash != p.hashCode());

View File

@ -303,7 +303,7 @@ public final class ActiveMQClient {
*/ */
public static void initializeGlobalThreadPoolProperties() { public static void initializeGlobalThreadPoolProperties() {
setGlobalThreadPoolProperties(Integer.valueOf(System.getProperty(ActiveMQClient.THREAD_POOL_MAX_SIZE_PROPERTY_KEY, "" + ActiveMQClient.DEFAULT_GLOBAL_THREAD_POOL_MAX_SIZE)), Integer.valueOf(System.getProperty(ActiveMQClient.SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY, "" + ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE)), Integer.valueOf(System.getProperty(ActiveMQClient.FLOW_CONTROL_THREAD_POOL_SIZE_PROPERTY_KEY, "" + ActiveMQClient.DEFAULT_FLOW_CONTROL_THREAD_POOL_MAX_SIZE))); setGlobalThreadPoolProperties(Integer.parseInt(System.getProperty(ActiveMQClient.THREAD_POOL_MAX_SIZE_PROPERTY_KEY, "" + ActiveMQClient.DEFAULT_GLOBAL_THREAD_POOL_MAX_SIZE)), Integer.parseInt(System.getProperty(ActiveMQClient.SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY, "" + ActiveMQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE)), Integer.parseInt(System.getProperty(ActiveMQClient.FLOW_CONTROL_THREAD_POOL_SIZE_PROPERTY_KEY, "" + ActiveMQClient.DEFAULT_FLOW_CONTROL_THREAD_POOL_MAX_SIZE)));
} }
/** /**

View File

@ -95,7 +95,7 @@ public class TCPServerLocatorSchema extends AbstractServerLocatorSchema {
private static int getPort(Map<String, Object> params) { private static int getPort(Map<String, Object> params) {
Object port = params.get("port"); Object port = params.get("port");
if (port instanceof String) { if (port instanceof String) {
return Integer.valueOf((String) port); return Integer.parseInt((String) port);
} }
return port != null ? (int) port : 61616; return port != null ? (int) port : 61616;
} }

View File

@ -55,7 +55,7 @@ public class ConfigurationHelper {
// The resource adapter will aways send Strings, hence the conversion here // The resource adapter will aways send Strings, hence the conversion here
if (prop instanceof String) { if (prop instanceof String) {
try { try {
return Integer.valueOf((String) prop); return Integer.parseInt((String) prop);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
ActiveMQClientLogger.LOGGER.propertyNotInteger(propName, prop.getClass().getName()); ActiveMQClientLogger.LOGGER.propertyNotInteger(propName, prop.getClass().getName());
@ -84,7 +84,7 @@ public class ConfigurationHelper {
// The resource adapter will aways send Strings, hence the conversion here // The resource adapter will aways send Strings, hence the conversion here
if (prop instanceof String) { if (prop instanceof String) {
try { try {
return Long.valueOf((String) prop); return Long.parseLong((String) prop);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
ActiveMQClientLogger.LOGGER.propertyNotLong(propName, prop.getClass().getName()); ActiveMQClientLogger.LOGGER.propertyNotLong(propName, prop.getClass().getName());
return def; return def;

View File

@ -111,9 +111,9 @@ public final class VersionLoader {
try { try {
versionProps.load(in); versionProps.load(in);
String versionName = versionProps.getProperty("activemq.version.versionName"); String versionName = versionProps.getProperty("activemq.version.versionName");
int majorVersion = Integer.valueOf(versionProps.getProperty("activemq.version.majorVersion")); int majorVersion = Integer.parseInt(versionProps.getProperty("activemq.version.majorVersion"));
int minorVersion = Integer.valueOf(versionProps.getProperty("activemq.version.minorVersion")); int minorVersion = Integer.parseInt(versionProps.getProperty("activemq.version.minorVersion"));
int microVersion = Integer.valueOf(versionProps.getProperty("activemq.version.microVersion")); int microVersion = Integer.parseInt(versionProps.getProperty("activemq.version.microVersion"));
int[] incrementingVersions = parseCompatibleVersionList(versionProps.getProperty("activemq.version.incrementingVersion")); int[] incrementingVersions = parseCompatibleVersionList(versionProps.getProperty("activemq.version.incrementingVersion"));
int[] compatibleVersionArray = parseCompatibleVersionList(versionProps.getProperty("activemq.version.compatibleVersionList")); int[] compatibleVersionArray = parseCompatibleVersionList(versionProps.getProperty("activemq.version.compatibleVersionList"));
List<Version> definedVersions = new ArrayList<>(incrementingVersions.length); List<Version> definedVersions = new ArrayList<>(incrementingVersions.length);

View File

@ -84,7 +84,7 @@ public class PropertySQLProvider implements SQLProvider {
@Override @Override
public long getMaxBlobSize() { public long getMaxBlobSize() {
return Long.valueOf(sql("max-blob-size")); return Long.parseLong(sql("max-blob-size"));
} }
@Override @Override

View File

@ -45,8 +45,8 @@ public class ActiveMQConnectionMetaData implements ConnectionMetaData {
} catch (IOException e) { } catch (IOException e) {
} }
JMS_VERSION_NAME = versionProps.getProperty("activemq.version.implementation.versionName", "2.0"); JMS_VERSION_NAME = versionProps.getProperty("activemq.version.implementation.versionName", "2.0");
JMS_MAJOR_VERSION = Integer.valueOf(versionProps.getProperty("activemq.version.implementation.majorVersion", "2")); JMS_MAJOR_VERSION = Integer.parseInt(versionProps.getProperty("activemq.version.implementation.majorVersion", "2"));
JMS_MINOR_VERSION = Integer.valueOf(versionProps.getProperty("activemq.version.implementation.minorVersion", "0")); JMS_MINOR_VERSION = Integer.parseInt(versionProps.getProperty("activemq.version.implementation.minorVersion", "0"));
} }

View File

@ -1687,13 +1687,13 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putBooleanProperty(String key, boolean value) { public final org.apache.activemq.artemis.api.core.Message putBooleanProperty(String key, boolean value) {
getApplicationPropertiesMap(true).put(key, Boolean.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putByteProperty(String key, byte value) { public final org.apache.activemq.artemis.api.core.Message putByteProperty(String key, byte value) {
getApplicationPropertiesMap(true).put(key, Byte.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@ -1705,43 +1705,43 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putShortProperty(String key, short value) { public final org.apache.activemq.artemis.api.core.Message putShortProperty(String key, short value) {
getApplicationPropertiesMap(true).put(key, Short.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putCharProperty(String key, char value) { public final org.apache.activemq.artemis.api.core.Message putCharProperty(String key, char value) {
getApplicationPropertiesMap(true).put(key, Character.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putIntProperty(String key, int value) { public final org.apache.activemq.artemis.api.core.Message putIntProperty(String key, int value) {
getApplicationPropertiesMap(true).put(key, Integer.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putLongProperty(String key, long value) { public final org.apache.activemq.artemis.api.core.Message putLongProperty(String key, long value) {
getApplicationPropertiesMap(true).put(key, Long.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putFloatProperty(String key, float value) { public final org.apache.activemq.artemis.api.core.Message putFloatProperty(String key, float value) {
getApplicationPropertiesMap(true).put(key, Float.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putDoubleProperty(String key, double value) { public final org.apache.activemq.artemis.api.core.Message putDoubleProperty(String key, double value) {
getApplicationPropertiesMap(true).put(key, Double.valueOf(value)); getApplicationPropertiesMap(true).put(key, value);
return this; return this;
} }
@Override @Override
public final org.apache.activemq.artemis.api.core.Message putBooleanProperty(SimpleString key, boolean value) { public final org.apache.activemq.artemis.api.core.Message putBooleanProperty(SimpleString key, boolean value) {
getApplicationPropertiesMap(true).put(key.toString(), Boolean.valueOf(value)); getApplicationPropertiesMap(true).put(key.toString(), value);
return this; return this;
} }

View File

@ -2220,7 +2220,7 @@ public class AMQPMessageTest {
Object priorityObj = cd.get(CompositeDataConstants.PRIORITY); Object priorityObj = cd.get(CompositeDataConstants.PRIORITY);
assertTrue(priorityObj instanceof Byte); assertTrue(priorityObj instanceof Byte);
assertEquals(Byte.valueOf((byte) 4), priorityObj); assertEquals((byte) 4, priorityObj);
// With section present, but value not set (defaults 4) // With section present, but value not set (defaults 4)
Header protonHeader = new Header(); Header protonHeader = new Header();
@ -2233,7 +2233,7 @@ public class AMQPMessageTest {
priorityObj = cd.get(CompositeDataConstants.PRIORITY); priorityObj = cd.get(CompositeDataConstants.PRIORITY);
assertTrue(priorityObj instanceof Byte); assertTrue(priorityObj instanceof Byte);
assertEquals(Byte.valueOf((byte) 4), priorityObj); assertEquals((byte) 4, priorityObj);
// With section present, value set to 5 explicitly // With section present, value set to 5 explicitly
protonHeader = new Header(); protonHeader = new Header();
@ -2247,7 +2247,7 @@ public class AMQPMessageTest {
priorityObj = cd.get(CompositeDataConstants.PRIORITY); priorityObj = cd.get(CompositeDataConstants.PRIORITY);
assertTrue(priorityObj instanceof Byte); assertTrue(priorityObj instanceof Byte);
assertEquals(Byte.valueOf((byte) 5), priorityObj); assertEquals((byte) 5, priorityObj);
} }
@Test @Test

View File

@ -154,7 +154,7 @@ public class TestConversions extends Assert {
Map<String, Object> mapValues = new HashMap<>(); Map<String, Object> mapValues = new HashMap<>();
mapValues.put("somestr", "value"); mapValues.put("somestr", "value");
mapValues.put("someint", Integer.valueOf(1)); mapValues.put("someint", 1);
message.setBody(new AmqpValue(mapValues)); message.setBody(new AmqpValue(mapValues));
@ -183,7 +183,7 @@ public class TestConversions extends Assert {
message.setApplicationProperties(properties); message.setApplicationProperties(properties);
List<Object> objects = new LinkedList<>(); List<Object> objects = new LinkedList<>();
objects.add(Integer.valueOf(10)); objects.add(10);
objects.add("10"); objects.add("10");
message.setBody(new AmqpSequence(objects)); message.setBody(new AmqpSequence(objects));
@ -269,7 +269,7 @@ public class TestConversions extends Assert {
Map<String, Object> mapValues = new HashMap<>(); Map<String, Object> mapValues = new HashMap<>();
mapValues.put("somestr", "value"); mapValues.put("somestr", "value");
mapValues.put("someint", Integer.valueOf(1)); mapValues.put("someint", 1);
message.setMessageAnnotations(messageAnnotations); message.setMessageAnnotations(messageAnnotations);
message.setBody(new AmqpValue(mapValues)); message.setBody(new AmqpValue(mapValues));
@ -321,7 +321,7 @@ public class TestConversions extends Assert {
Map<String, Object> mapValues = new HashMap<>(); Map<String, Object> mapValues = new HashMap<>();
mapValues.put("somestr", "value"); mapValues.put("somestr", "value");
mapValues.put("someint", Integer.valueOf(1)); mapValues.put("someint", 1);
message.setFooter(messageFooter); message.setFooter(messageFooter);
message.setBody(new AmqpValue(mapValues)); message.setBody(new AmqpValue(mapValues));

View File

@ -166,7 +166,7 @@ public class AMQPMessageIdHelperTest {
*/ */
@Test @Test
public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForLong() { public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForLong() {
String longStringMessageId = AMQPMessageIdHelper.AMQP_ULONG_PREFIX + Long.valueOf(123456789L); String longStringMessageId = AMQPMessageIdHelper.AMQP_ULONG_PREFIX + 123456789L;
String expected = AMQPMessageIdHelper.JMS_ID_PREFIX + AMQPMessageIdHelper.AMQP_NO_PREFIX + longStringMessageId; String expected = AMQPMessageIdHelper.JMS_ID_PREFIX + AMQPMessageIdHelper.AMQP_NO_PREFIX + longStringMessageId;
doToMessageIdTestImpl(longStringMessageId, expected); doToMessageIdTestImpl(longStringMessageId, expected);
@ -398,7 +398,7 @@ public class AMQPMessageIdHelperTest {
*/ */
@Test @Test
public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForLong() { public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForLong() {
String ulongPrefixStringCorrelationId = AMQPMessageIdHelper.AMQP_ULONG_PREFIX + Long.valueOf(123456789L); String ulongPrefixStringCorrelationId = AMQPMessageIdHelper.AMQP_ULONG_PREFIX + 123456789L;
doToCorrelationIDTestImpl(ulongPrefixStringCorrelationId, ulongPrefixStringCorrelationId); doToCorrelationIDTestImpl(ulongPrefixStringCorrelationId, ulongPrefixStringCorrelationId);
} }

View File

@ -480,7 +480,7 @@ public class MQTTPublishManager {
for (SimpleString propertyName : message.getPropertyNames()) { for (SimpleString propertyName : message.getPropertyNames()) {
if (propertyName.startsWith(MQTT_USER_PROPERTY_KEY_PREFIX_SIMPLE)) { if (propertyName.startsWith(MQTT_USER_PROPERTY_KEY_PREFIX_SIMPLE)) {
SimpleString[] split = propertyName.split('.'); SimpleString[] split = propertyName.split('.');
int position = Integer.valueOf(split[4].toString()); int position = Integer.parseInt(split[4].toString());
String key = propertyName.subSeq(MQTT_USER_PROPERTY_KEY_PREFIX_SIMPLE.length() + split[4].length() + 1, propertyName.length()).toString(); String key = propertyName.subSeq(MQTT_USER_PROPERTY_KEY_PREFIX_SIMPLE.length() + split[4].length() + 1, propertyName.length()).toString();
orderedProperties[position] = new MqttProperties.StringPair(key, message.getStringProperty(propertyName)); orderedProperties[position] = new MqttProperties.StringPair(key, message.getStringProperty(propertyName));
} }

View File

@ -171,7 +171,7 @@ public class OpenWireProtocolManager extends AbstractProtocolManager<Command, O
public boolean selectorAware; public boolean selectorAware;
public VirtualTopicConfig(String[] configuration) { public VirtualTopicConfig(String[] configuration) {
filterPathTerminus = Integer.valueOf(configuration[1]); filterPathTerminus = Integer.parseInt(configuration[1]);
// optional config // optional config
for (int i = 2; i < configuration.length; i++) { for (int i = 2; i < configuration.length; i++) {
String[] optionPair = configuration[i].split("="); String[] optionPair = configuration[i].split("=");
@ -182,7 +182,7 @@ public class OpenWireProtocolManager extends AbstractProtocolManager<Command, O
private void consumeOption(String[] optionPair) { private void consumeOption(String[] optionPair) {
if (optionPair.length == 2) { if (optionPair.length == 2) {
if (SELECTOR_AWARE_OPTION.equals(optionPair[0])) { if (SELECTOR_AWARE_OPTION.equals(optionPair[0])) {
selectorAware = Boolean.valueOf(optionPair[1]); selectorAware = Boolean.parseBoolean(optionPair[1]);
} }
} }
} }

View File

@ -135,9 +135,9 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
} }
//client ping //client ping
long minPingInterval = Long.valueOf(params[0]); long minPingInterval = Long.parseLong(params[0]);
//client receive ping //client receive ping
long minAcceptInterval = Long.valueOf(params[1]); long minAcceptInterval = Long.parseLong(params[1]);
if (heartBeater == null) { if (heartBeater == null) {
heartBeater = new HeartBeater(scheduledExecutorService, executorFactory.getExecutor(), minPingInterval, minAcceptInterval); heartBeater = new HeartBeater(scheduledExecutorService, executorFactory.getExecutor(), minPingInterval, minAcceptInterval);
@ -285,7 +285,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
if (connectionEntry != null) { if (connectionEntry != null) {
String heartBeatToTtlModifierStr = (String) connection.getAcceptorUsed().getConfiguration().get(TransportConstants.HEART_BEAT_TO_CONNECTION_TTL_MODIFIER); String heartBeatToTtlModifierStr = (String) connection.getAcceptorUsed().getConfiguration().get(TransportConstants.HEART_BEAT_TO_CONNECTION_TTL_MODIFIER);
double heartBeatToTtlModifier = heartBeatToTtlModifierStr == null ? 2 : Double.valueOf(heartBeatToTtlModifierStr); double heartBeatToTtlModifier = heartBeatToTtlModifierStr == null ? 2 : Double.parseDouble(heartBeatToTtlModifierStr);
// the default response to the client // the default response to the client
clientPingResponse = (long) (connectionEntry.ttl / heartBeatToTtlModifier); clientPingResponse = (long) (connectionEntry.ttl / heartBeatToTtlModifier);
@ -293,10 +293,10 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
if (clientPing != 0) { if (clientPing != 0) {
clientPingResponse = clientPing; clientPingResponse = clientPing;
String ttlMaxStr = (String) connection.getAcceptorUsed().getConfiguration().get(TransportConstants.CONNECTION_TTL_MAX); String ttlMaxStr = (String) connection.getAcceptorUsed().getConfiguration().get(TransportConstants.CONNECTION_TTL_MAX);
long ttlMax = ttlMaxStr == null ? Long.MAX_VALUE : Long.valueOf(ttlMaxStr); long ttlMax = ttlMaxStr == null ? Long.MAX_VALUE : Long.parseLong(ttlMaxStr);
String ttlMinStr = (String) connection.getAcceptorUsed().getConfiguration().get(TransportConstants.CONNECTION_TTL_MIN); String ttlMinStr = (String) connection.getAcceptorUsed().getConfiguration().get(TransportConstants.CONNECTION_TTL_MIN);
long ttlMin = ttlMinStr == null ? 1000 : Long.valueOf(ttlMinStr); long ttlMin = ttlMinStr == null ? 1000 : Long.parseLong(ttlMinStr);
/* The connection's TTL should be one of the following: /* The connection's TTL should be one of the following:
* 1) clientPing * heartBeatToTtlModifier * 1) clientPing * heartBeatToTtlModifier

View File

@ -48,8 +48,8 @@ public class ActiveMQRAConnectionMetaData implements ConnectionMetaData {
} catch (IOException e) { } catch (IOException e) {
} }
JMS_VERSION_NAME = versionProps.getProperty("activemq.version.implementation.versionName", "2.0"); JMS_VERSION_NAME = versionProps.getProperty("activemq.version.implementation.versionName", "2.0");
JMS_MAJOR_VERSION = Integer.valueOf(versionProps.getProperty("activemq.version.implementation.majorVersion", "2")); JMS_MAJOR_VERSION = Integer.parseInt(versionProps.getProperty("activemq.version.implementation.majorVersion", "2"));
JMS_MINOR_VERSION = Integer.valueOf(versionProps.getProperty("activemq.version.implementation.minorVersion", "0")); JMS_MINOR_VERSION = Integer.parseInt(versionProps.getProperty("activemq.version.implementation.minorVersion", "0"));
} }
/** /**

View File

@ -51,26 +51,26 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
} }
static { static {
REGEXP_CONTROL_CHARS.add(Character.valueOf('.')); REGEXP_CONTROL_CHARS.add('.');
REGEXP_CONTROL_CHARS.add(Character.valueOf('\\')); REGEXP_CONTROL_CHARS.add('\\');
REGEXP_CONTROL_CHARS.add(Character.valueOf('[')); REGEXP_CONTROL_CHARS.add('[');
REGEXP_CONTROL_CHARS.add(Character.valueOf(']')); REGEXP_CONTROL_CHARS.add(']');
REGEXP_CONTROL_CHARS.add(Character.valueOf('^')); REGEXP_CONTROL_CHARS.add('^');
REGEXP_CONTROL_CHARS.add(Character.valueOf('$')); REGEXP_CONTROL_CHARS.add('$');
REGEXP_CONTROL_CHARS.add(Character.valueOf('?')); REGEXP_CONTROL_CHARS.add('?');
REGEXP_CONTROL_CHARS.add(Character.valueOf('*')); REGEXP_CONTROL_CHARS.add('*');
REGEXP_CONTROL_CHARS.add(Character.valueOf('+')); REGEXP_CONTROL_CHARS.add('+');
REGEXP_CONTROL_CHARS.add(Character.valueOf('{')); REGEXP_CONTROL_CHARS.add('{');
REGEXP_CONTROL_CHARS.add(Character.valueOf('}')); REGEXP_CONTROL_CHARS.add('}');
REGEXP_CONTROL_CHARS.add(Character.valueOf('|')); REGEXP_CONTROL_CHARS.add('|');
REGEXP_CONTROL_CHARS.add(Character.valueOf('(')); REGEXP_CONTROL_CHARS.add('(');
REGEXP_CONTROL_CHARS.add(Character.valueOf(')')); REGEXP_CONTROL_CHARS.add(')');
REGEXP_CONTROL_CHARS.add(Character.valueOf(':')); REGEXP_CONTROL_CHARS.add(':');
REGEXP_CONTROL_CHARS.add(Character.valueOf('&')); REGEXP_CONTROL_CHARS.add('&');
REGEXP_CONTROL_CHARS.add(Character.valueOf('<')); REGEXP_CONTROL_CHARS.add('<');
REGEXP_CONTROL_CHARS.add(Character.valueOf('>')); REGEXP_CONTROL_CHARS.add('>');
REGEXP_CONTROL_CHARS.add(Character.valueOf('=')); REGEXP_CONTROL_CHARS.add('=');
REGEXP_CONTROL_CHARS.add(Character.valueOf('!')); REGEXP_CONTROL_CHARS.add('!');
} }
static class LikeExpression extends UnaryExpression implements BooleanExpression { static class LikeExpression extends UnaryExpression implements BooleanExpression {
@ -114,7 +114,7 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
regexp.append(".*?"); // Do a non-greedy match regexp.append(".*?"); // Do a non-greedy match
} else if (c == '_') { } else if (c == '_') {
regexp.append("."); // match one 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("\\x");
regexp.append(Integer.toHexString(0xFFFF & c)); regexp.append(Integer.toHexString(0xFFFF & c));
} else { } else {

View File

@ -65,25 +65,25 @@ public class ConstantExpression implements Expression {
long l = value.longValue(); long l = value.longValue();
if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) {
value = Integer.valueOf(value.intValue()); value = value.intValue();
} }
return new ConstantExpression(value); return new ConstantExpression(value);
} }
public static ConstantExpression createFromHex(String text) { 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(); long l = value.longValue();
if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) {
value = Integer.valueOf(value.intValue()); value = value.intValue();
} }
return new ConstantExpression(value); return new ConstantExpression(value);
} }
public static ConstantExpression createFromOctal(String text) { public static ConstantExpression createFromOctal(String text) {
Number value = Long.valueOf(Long.parseLong(text, 8)); Number value = Long.parseLong(text, 8);
long l = value.longValue(); long l = value.longValue();
if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) { if (Integer.MIN_VALUE <= l && l <= Integer.MAX_VALUE) {
value = Integer.valueOf(value.intValue()); value = value.intValue();
} }
return new ConstantExpression(value); return new ConstantExpression(value);
} }
@ -111,7 +111,7 @@ public class ConstantExpression implements Expression {
return "NULL"; return "NULL";
} }
if (value instanceof Boolean) { if (value instanceof Boolean) {
return ((Boolean) value).booleanValue() ? "TRUE" : "FALSE"; return (Boolean) value ? "TRUE" : "FALSE";
} }
if (value instanceof String) { if (value instanceof String) {
return encodeString((String) value); return encodeString((String) value);

View File

@ -212,7 +212,7 @@ public abstract class UnaryExpression implements Expression {
bd = bd.negate(); bd = bd.negate();
if (BD_LONG_MIN_VALUE.compareTo(bd) == 0) { if (BD_LONG_MIN_VALUE.compareTo(bd) == 0) {
return Long.valueOf(Long.MIN_VALUE); return Long.MIN_VALUE;
} }
return bd; return bd;
} else { } else {

View File

@ -173,7 +173,7 @@ public class FilterImpl implements Filter {
return SimpleString.toSimpleString("ID:" + msg.getUserID()); return SimpleString.toSimpleString("ID:" + msg.getUserID());
} }
} else if (FilterConstants.ACTIVEMQ_PRIORITY.equals(fieldName)) { } else if (FilterConstants.ACTIVEMQ_PRIORITY.equals(fieldName)) {
return Integer.valueOf(msg.getPriority()); return (int) msg.getPriority();
} else if (FilterConstants.ACTIVEMQ_TIMESTAMP.equals(fieldName)) { } else if (FilterConstants.ACTIVEMQ_TIMESTAMP.equals(fieldName)) {
return msg.getTimestamp(); return msg.getTimestamp();
} else if (FilterConstants.ACTIVEMQ_DURABLE.equals(fieldName)) { } else if (FilterConstants.ACTIVEMQ_DURABLE.equals(fieldName)) {

View File

@ -2434,7 +2434,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
if (session.getName().equals(sessionID.toString())) { if (session.getName().equals(sessionID.toString())) {
Set<ServerConsumer> serverConsumers = session.getServerConsumers(); Set<ServerConsumer> serverConsumers = session.getServerConsumers();
for (ServerConsumer serverConsumer : serverConsumers) { for (ServerConsumer serverConsumer : serverConsumers) {
if (serverConsumer.sequentialID() == Long.valueOf(ID)) { if (serverConsumer.sequentialID() == Long.parseLong(ID)) {
serverConsumer.disconnect(); serverConsumer.disconnect();
return true; return true;
} }

View File

@ -1143,7 +1143,7 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
Filter filter = FilterImpl.createFilter(filterStr); Filter filter = FilterImpl.createFilter(filterStr);
SimpleString groupByProperty = SimpleString.toSimpleString(groupByPropertyStr); SimpleString groupByProperty = SimpleString.toSimpleString(groupByPropertyStr);
if (filter == null && groupByProperty == null) { if (filter == null && groupByProperty == null) {
result.put(null, Long.valueOf(getDeliveringCount())); result.put(null, (long) getDeliveringCount());
} else { } else {
Map<String, List<MessageReference>> deliveringMessages = queue.getDeliveringMessages(); Map<String, List<MessageReference>> deliveringMessages = queue.getDeliveringMessages();
deliveringMessages.forEach((s, messageReferenceList) -> messageReferenceList.forEach(messageReference -> internalComputeMessage(result, filter, groupByProperty, messageReference.getMessage()))); deliveringMessages.forEach((s, messageReferenceList) -> messageReferenceList.forEach(messageReference -> internalComputeMessage(result, filter, groupByProperty, messageReference.getMessage())));

View File

@ -232,7 +232,7 @@ public final class PageSubscriptionImpl implements PageSubscription {
PageCursorInfo info = new PageCursorInfo(position.getPageNr(), position.getMessageNr()); PageCursorInfo info = new PageCursorInfo(position.getPageNr(), position.getMessageNr());
info.setCompleteInfo(position); info.setCompleteInfo(position);
synchronized (consumedPages) { synchronized (consumedPages) {
consumedPages.put(Long.valueOf(position.getPageNr()), info); consumedPages.put(position.getPageNr(), info);
} }
return true; return true;
@ -743,7 +743,7 @@ public final class PageSubscriptionImpl implements PageSubscription {
logger.debug("removing page {}", deletedPage); logger.debug("removing page {}", deletedPage);
PageCursorInfo info; PageCursorInfo info;
synchronized (consumedPages) { synchronized (consumedPages) {
info = consumedPages.remove(Long.valueOf(deletedPage.getPageId())); info = consumedPages.remove(deletedPage.getPageId());
} }
if (info != null) { if (info != null) {
PagePosition completeInfo = info.getCompleteInfo(); PagePosition completeInfo = info.getCompleteInfo();

View File

@ -63,7 +63,7 @@ public final class PagingManagerImpl implements PagingManager {
private static final int PAGE_TX_CLEANUP_PRINT_LIMIT = 1000; private static final int PAGE_TX_CLEANUP_PRINT_LIMIT = 1000;
private static final int ARTEMIS_PAGING_COUNTER_SNAPSHOT_INTERVAL = Integer.valueOf(System.getProperty("artemis.paging.counter.snapshot.interval", "60")); private static final int ARTEMIS_PAGING_COUNTER_SNAPSHOT_INTERVAL = Integer.parseInt(System.getProperty("artemis.paging.counter.snapshot.interval", "60"));
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

View File

@ -236,11 +236,11 @@ public class ManagementServiceImpl implements ManagementService {
MetricsManager metricsManager = messagingServer.getMetricsManager(); MetricsManager metricsManager = messagingServer.getMetricsManager();
if (metricsManager != null) { if (metricsManager != null) {
metricsManager.registerBrokerGauge(builder -> { metricsManager.registerBrokerGauge(builder -> {
builder.build(BrokerMetricNames.CONNECTION_COUNT, messagingServer, metrics -> Double.valueOf(messagingServer.getConnectionCount()), ActiveMQServerControl.CONNECTION_COUNT_DESCRIPTION); builder.build(BrokerMetricNames.CONNECTION_COUNT, messagingServer, metrics -> (double) messagingServer.getConnectionCount(), ActiveMQServerControl.CONNECTION_COUNT_DESCRIPTION);
builder.build(BrokerMetricNames.TOTAL_CONNECTION_COUNT, messagingServer, metrics -> Double.valueOf(messagingServer.getTotalConnectionCount()), ActiveMQServerControl.TOTAL_CONNECTION_COUNT_DESCRIPTION); builder.build(BrokerMetricNames.TOTAL_CONNECTION_COUNT, messagingServer, metrics -> (double) messagingServer.getTotalConnectionCount(), ActiveMQServerControl.TOTAL_CONNECTION_COUNT_DESCRIPTION);
builder.build(BrokerMetricNames.ADDRESS_MEMORY_USAGE, messagingServer, metrics -> Double.valueOf(messagingServerControl.getAddressMemoryUsage()), ActiveMQServerControl.ADDRESS_MEMORY_USAGE_DESCRIPTION); builder.build(BrokerMetricNames.ADDRESS_MEMORY_USAGE, messagingServer, metrics -> (double) messagingServerControl.getAddressMemoryUsage(), ActiveMQServerControl.ADDRESS_MEMORY_USAGE_DESCRIPTION);
builder.build(BrokerMetricNames.ADDRESS_MEMORY_USAGE_PERCENTAGE, messagingServer, metrics -> Double.valueOf(messagingServerControl.getAddressMemoryUsagePercentage()), ActiveMQServerControl.ADDRESS_MEMORY_USAGE_PERCENTAGE_DESCRIPTION); builder.build(BrokerMetricNames.ADDRESS_MEMORY_USAGE_PERCENTAGE, messagingServer, metrics -> (double) messagingServerControl.getAddressMemoryUsagePercentage(), ActiveMQServerControl.ADDRESS_MEMORY_USAGE_PERCENTAGE_DESCRIPTION);
builder.build(BrokerMetricNames.DISK_STORE_USAGE, messagingServer, metrics -> Double.valueOf(messagingServer.getDiskStoreUsage()), ActiveMQServerControl.DISK_STORE_USAGE_DESCRIPTION); builder.build(BrokerMetricNames.DISK_STORE_USAGE, messagingServer, metrics -> messagingServer.getDiskStoreUsage(), ActiveMQServerControl.DISK_STORE_USAGE_DESCRIPTION);
builder.build(BrokerMetricNames.REPLICA_SYNC, messagingServer, metrics -> messagingServer.isReplicaSync() ? 1D : 0D, ActiveMQServerControl.REPLICA_SYNC_DESCRIPTION); builder.build(BrokerMetricNames.REPLICA_SYNC, messagingServer, metrics -> messagingServer.isReplicaSync() ? 1D : 0D, ActiveMQServerControl.REPLICA_SYNC_DESCRIPTION);
builder.build(BrokerMetricNames.ACTIVE, messagingServer, metrics -> messagingServer.isActive() ? 1D : 0D, ActiveMQServerControl.IS_ACTIVE_DESCRIPTION); builder.build(BrokerMetricNames.ACTIVE, messagingServer, metrics -> messagingServer.isActive() ? 1D : 0D, ActiveMQServerControl.IS_ACTIVE_DESCRIPTION);
}); });
@ -277,10 +277,10 @@ public class ManagementServiceImpl implements ManagementService {
MetricsManager metricsManager = messagingServer.getMetricsManager(); MetricsManager metricsManager = messagingServer.getMetricsManager();
if (metricsManager != null) { if (metricsManager != null) {
metricsManager.registerAddressGauge(addressInfo.getName().toString(), builder -> { metricsManager.registerAddressGauge(addressInfo.getName().toString(), builder -> {
builder.build(AddressMetricNames.ROUTED_MESSAGE_COUNT, addressInfo, metrics -> Double.valueOf(addressInfo.getRoutedMessageCount()), AddressControl.ROUTED_MESSAGE_COUNT_DESCRIPTION); builder.build(AddressMetricNames.ROUTED_MESSAGE_COUNT, addressInfo, metrics -> (double) addressInfo.getRoutedMessageCount(), AddressControl.ROUTED_MESSAGE_COUNT_DESCRIPTION);
builder.build(AddressMetricNames.UNROUTED_MESSAGE_COUNT, addressInfo, metrics -> Double.valueOf(addressInfo.getUnRoutedMessageCount()), AddressControl.UNROUTED_MESSAGE_COUNT_DESCRIPTION); builder.build(AddressMetricNames.UNROUTED_MESSAGE_COUNT, addressInfo, metrics -> (double) addressInfo.getUnRoutedMessageCount(), AddressControl.UNROUTED_MESSAGE_COUNT_DESCRIPTION);
builder.build(AddressMetricNames.ADDRESS_SIZE, addressInfo, metrics -> Double.valueOf(addressControl.getAddressSize()), AddressControl.ADDRESS_SIZE_DESCRIPTION); builder.build(AddressMetricNames.ADDRESS_SIZE, addressInfo, metrics -> (double) addressControl.getAddressSize(), AddressControl.ADDRESS_SIZE_DESCRIPTION);
builder.build(AddressMetricNames.PAGES_COUNT, addressInfo, metrics -> Double.valueOf(addressControl.getNumberOfPages()), AddressControl.NUMBER_OF_PAGES_DESCRIPTION); builder.build(AddressMetricNames.PAGES_COUNT, addressInfo, metrics -> (double) addressControl.getNumberOfPages(), AddressControl.NUMBER_OF_PAGES_DESCRIPTION);
}); });
} }
} }
@ -336,26 +336,26 @@ public class ManagementServiceImpl implements ManagementService {
MetricsManager metricsManager = messagingServer.getMetricsManager(); MetricsManager metricsManager = messagingServer.getMetricsManager();
if (metricsManager != null) { if (metricsManager != null) {
metricsManager.registerQueueGauge(queue.getAddress().toString(), queue.getName().toString(), (builder) -> { metricsManager.registerQueueGauge(queue.getAddress().toString(), queue.getName().toString(), (builder) -> {
builder.build(QueueMetricNames.MESSAGE_COUNT, queue, metrics -> Double.valueOf(queue.getMessageCount()), QueueControl.MESSAGE_COUNT_DESCRIPTION); builder.build(QueueMetricNames.MESSAGE_COUNT, queue, metrics -> (double) queue.getMessageCount(), QueueControl.MESSAGE_COUNT_DESCRIPTION);
builder.build(QueueMetricNames.DURABLE_MESSAGE_COUNT, queue, metrics -> Double.valueOf(queue.getDurableMessageCount()), QueueControl.DURABLE_MESSAGE_COUNT_DESCRIPTION); builder.build(QueueMetricNames.DURABLE_MESSAGE_COUNT, queue, metrics -> (double) queue.getDurableMessageCount(), QueueControl.DURABLE_MESSAGE_COUNT_DESCRIPTION);
builder.build(QueueMetricNames.PERSISTENT_SIZE, queue, metrics -> Double.valueOf(queue.getPersistentSize()), QueueControl.PERSISTENT_SIZE_DESCRIPTION); builder.build(QueueMetricNames.PERSISTENT_SIZE, queue, metrics -> (double) queue.getPersistentSize(), QueueControl.PERSISTENT_SIZE_DESCRIPTION);
builder.build(QueueMetricNames.DURABLE_PERSISTENT_SIZE, queue, metrics -> Double.valueOf(queue.getDurablePersistentSize()), QueueControl.DURABLE_PERSISTENT_SIZE_DESCRIPTION); builder.build(QueueMetricNames.DURABLE_PERSISTENT_SIZE, queue, metrics -> (double) queue.getDurablePersistentSize(), QueueControl.DURABLE_PERSISTENT_SIZE_DESCRIPTION);
builder.build(QueueMetricNames.DELIVERING_MESSAGE_COUNT, queue, metrics -> Double.valueOf(queue.getDeliveringCount()), QueueControl.DELIVERING_MESSAGE_COUNT_DESCRIPTION); builder.build(QueueMetricNames.DELIVERING_MESSAGE_COUNT, queue, metrics -> (double) queue.getDeliveringCount(), QueueControl.DELIVERING_MESSAGE_COUNT_DESCRIPTION);
builder.build(QueueMetricNames.DELIVERING_DURABLE_MESSAGE_COUNT, queue, metrics -> Double.valueOf(queue.getDurableDeliveringCount()), QueueControl.DURABLE_DELIVERING_MESSAGE_COUNT_DESCRIPTION); builder.build(QueueMetricNames.DELIVERING_DURABLE_MESSAGE_COUNT, queue, metrics -> (double) queue.getDurableDeliveringCount(), QueueControl.DURABLE_DELIVERING_MESSAGE_COUNT_DESCRIPTION);
builder.build(QueueMetricNames.DELIVERING_PERSISTENT_SIZE, queue, metrics -> Double.valueOf(queue.getDeliveringSize()), QueueControl.DELIVERING_SIZE_DESCRIPTION); builder.build(QueueMetricNames.DELIVERING_PERSISTENT_SIZE, queue, metrics -> (double) queue.getDeliveringSize(), QueueControl.DELIVERING_SIZE_DESCRIPTION);
builder.build(QueueMetricNames.DELIVERING_DURABLE_PERSISTENT_SIZE, queue, metrics -> Double.valueOf(queue.getDurableDeliveringSize()), QueueControl.DURABLE_DELIVERING_SIZE_DESCRIPTION); builder.build(QueueMetricNames.DELIVERING_DURABLE_PERSISTENT_SIZE, queue, metrics -> (double) queue.getDurableDeliveringSize(), QueueControl.DURABLE_DELIVERING_SIZE_DESCRIPTION);
builder.build(QueueMetricNames.SCHEDULED_MESSAGE_COUNT, queue, metrics -> Double.valueOf(queue.getScheduledCount()), QueueControl.SCHEDULED_MESSAGE_COUNT_DESCRIPTION); builder.build(QueueMetricNames.SCHEDULED_MESSAGE_COUNT, queue, metrics -> (double) queue.getScheduledCount(), QueueControl.SCHEDULED_MESSAGE_COUNT_DESCRIPTION);
builder.build(QueueMetricNames.SCHEDULED_DURABLE_MESSAGE_COUNT, queue, metrics -> Double.valueOf(queue.getDurableScheduledCount()), QueueControl.DURABLE_SCHEDULED_MESSAGE_COUNT_DESCRIPTION); builder.build(QueueMetricNames.SCHEDULED_DURABLE_MESSAGE_COUNT, queue, metrics -> (double) queue.getDurableScheduledCount(), QueueControl.DURABLE_SCHEDULED_MESSAGE_COUNT_DESCRIPTION);
builder.build(QueueMetricNames.SCHEDULED_PERSISTENT_SIZE, queue, metrics -> Double.valueOf(queue.getScheduledSize()), QueueControl.SCHEDULED_SIZE_DESCRIPTION); builder.build(QueueMetricNames.SCHEDULED_PERSISTENT_SIZE, queue, metrics -> (double) queue.getScheduledSize(), QueueControl.SCHEDULED_SIZE_DESCRIPTION);
builder.build(QueueMetricNames.SCHEDULED_DURABLE_PERSISTENT_SIZE, queue, metrics -> Double.valueOf(queue.getDurableScheduledSize()), QueueControl.DURABLE_SCHEDULED_SIZE_DESCRIPTION); builder.build(QueueMetricNames.SCHEDULED_DURABLE_PERSISTENT_SIZE, queue, metrics -> (double) queue.getDurableScheduledSize(), QueueControl.DURABLE_SCHEDULED_SIZE_DESCRIPTION);
builder.build(QueueMetricNames.MESSAGES_ACKNOWLEDGED, queue, metrics -> Double.valueOf(queue.getMessagesAcknowledged()), QueueControl.MESSAGES_ACKNOWLEDGED_DESCRIPTION); builder.build(QueueMetricNames.MESSAGES_ACKNOWLEDGED, queue, metrics -> (double) queue.getMessagesAcknowledged(), QueueControl.MESSAGES_ACKNOWLEDGED_DESCRIPTION);
builder.build(QueueMetricNames.MESSAGES_ADDED, queue, metrics -> Double.valueOf(queue.getMessagesAdded()), QueueControl.MESSAGES_ADDED_DESCRIPTION); builder.build(QueueMetricNames.MESSAGES_ADDED, queue, metrics -> (double) queue.getMessagesAdded(), QueueControl.MESSAGES_ADDED_DESCRIPTION);
builder.build(QueueMetricNames.MESSAGES_KILLED, queue, metrics -> Double.valueOf(queue.getMessagesKilled()), QueueControl.MESSAGES_KILLED_DESCRIPTION); builder.build(QueueMetricNames.MESSAGES_KILLED, queue, metrics -> (double) queue.getMessagesKilled(), QueueControl.MESSAGES_KILLED_DESCRIPTION);
builder.build(QueueMetricNames.MESSAGES_EXPIRED, queue, metrics -> Double.valueOf(queue.getMessagesExpired()), QueueControl.MESSAGES_EXPIRED_DESCRIPTION); builder.build(QueueMetricNames.MESSAGES_EXPIRED, queue, metrics -> (double) queue.getMessagesExpired(), QueueControl.MESSAGES_EXPIRED_DESCRIPTION);
builder.build(QueueMetricNames.CONSUMER_COUNT, queue, metrics -> Double.valueOf(queue.getConsumerCount()), QueueControl.CONSUMER_COUNT_DESCRIPTION); builder.build(QueueMetricNames.CONSUMER_COUNT, queue, metrics -> (double) queue.getConsumerCount(), QueueControl.CONSUMER_COUNT_DESCRIPTION);
}); });
} }
} }

View File

@ -85,7 +85,7 @@ public class LeastConnectionsPolicy extends RoundRobinPolicy {
if (properties != null) { if (properties != null) {
if (properties.containsKey(CONNECTION_COUNT_THRESHOLD)) { if (properties.containsKey(CONNECTION_COUNT_THRESHOLD)) {
connectionCountThreshold = Integer.valueOf(properties.get(CONNECTION_COUNT_THRESHOLD)); connectionCountThreshold = Integer.parseInt(properties.get(CONNECTION_COUNT_THRESHOLD));
} }
} }
} }

View File

@ -292,7 +292,7 @@ public class ScheduledDeliveryHandlerTest extends Assert {
} }
for (long i = 0; i < numberOfExpectedMessages; i++) { for (long i = 0; i < numberOfExpectedMessages; i++) {
assertTrue(messages.contains(Long.valueOf(i))); assertTrue(messages.contains(i));
} }
} }
@ -1033,7 +1033,7 @@ public class ScheduledDeliveryHandlerTest extends Assert {
@Override @Override
public Long getID() { public Long getID() {
return Long.valueOf(0L); return 0L;
} }
@Override @Override

View File

@ -65,7 +65,7 @@ public class ConsistentHashModuloPolicyTest {
String[] values = new String[]{"ONE", "TWO", "THREE", "FOUR"}; String[] values = new String[]{"ONE", "TWO", "THREE", "FOUR"};
for (String v : values) { for (String v : values) {
assertTrue("non negative for: " + v, Integer.valueOf(underTest.transformKey(v)) >= 0); assertTrue("non negative for: " + v, Integer.parseInt(underTest.transformKey(v)) >= 0);
} }
} }
@ -87,7 +87,7 @@ public class ConsistentHashModuloPolicyTest {
assertNotNull(underTest.getProperties()); assertNotNull(underTest.getProperties());
for (int i = 0; i < negs.length; i++) { for (int i = 0; i < negs.length; i++) {
assertTrue("non negative for: " + i, Integer.valueOf(underTest.transformKey("BLA")) >= 0); assertTrue("non negative for: " + i, Integer.parseInt(underTest.transformKey("BLA")) >= 0);
} }
} }
} }

View File

@ -55,9 +55,9 @@ public class BrokerBenchmark extends BrokerTestSupport {
public void initCombosForTestPerformance() { public void initCombosForTestPerformance() {
addCombinationValues("destination", new Object[]{new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST")}); addCombinationValues("destination", new Object[]{new ActiveMQQueue("TEST"), new ActiveMQTopic("TEST")});
addCombinationValues("PRODUCER_COUNT", new Object[]{Integer.valueOf("1"), Integer.valueOf("10")}); addCombinationValues("PRODUCER_COUNT", new Object[]{1, 10});
addCombinationValues("CONSUMER_COUNT", new Object[]{Integer.valueOf("1"), Integer.valueOf("10")}); addCombinationValues("CONSUMER_COUNT", new Object[]{1, 10});
addCombinationValues("CONSUMER_COUNT", new Object[]{Integer.valueOf("1"), Integer.valueOf("10")}); addCombinationValues("CONSUMER_COUNT", new Object[]{1, 10});
addCombinationValues("deliveryMode", new Object[]{Boolean.TRUE}); addCombinationValues("deliveryMode", new Object[]{Boolean.TRUE});
} }

View File

@ -1181,10 +1181,10 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
Integer c = consumerCounts.get(tn); Integer c = consumerCounts.get(tn);
if (c == null) { if (c == null) {
c = Integer.valueOf(cnt); c = cnt;
} }
if (tn == threadNum && cnt != c.intValue()) { if (tn == threadNum && cnt != c) {
throw new Exception("Invalid count, expected " + tn + ": " + c + " got " + cnt); throw new Exception("Invalid count, expected " + tn + ": " + c + " got " + cnt);
} }
@ -1250,10 +1250,10 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
Integer c = counts.get(threadNum); Integer c = counts.get(threadNum);
if (c == null) { if (c == null) {
c = Integer.valueOf(cnt); c = cnt;
} }
if (tn == threadNum && cnt != c.intValue()) { if (tn == threadNum && cnt != c) {
failure = "Invalid count, expected " + threadNum + ":" + c + " got " + cnt; failure = "Invalid count, expected " + threadNum + ":" + c + " got " + cnt;
logger.error(failure); logger.error(failure);

View File

@ -223,7 +223,7 @@ public abstract class AbstractStompClientConnection implements StompClientConnec
private boolean validateFrame(ClientStompFrame f) { private boolean validateFrame(ClientStompFrame f) {
String h = f.getHeader(Stomp.Headers.CONTENT_LENGTH); String h = f.getHeader(Stomp.Headers.CONTENT_LENGTH);
if (h != null) { if (h != null) {
int len = Integer.valueOf(h); int len = Integer.parseInt(h);
if (f.getBody().getBytes(StandardCharsets.UTF_8).length < len) { if (f.getBody().getBytes(StandardCharsets.UTF_8).length < len) {
return false; return false;
} }

View File

@ -563,7 +563,7 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase {
int posPoint = value.lastIndexOf('.'); int posPoint = value.lastIndexOf('.');
int last = Integer.valueOf(value.substring(posPoint + 1)); int last = Integer.parseInt(value.substring(posPoint + 1));
return value.substring(0, posPoint + 1) + (last + variant); return value.substring(0, posPoint + 1) + (last + variant);
} }
@ -1718,8 +1718,8 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase {
// sendCallNumber is just a debugging measure. // sendCallNumber is just a debugging measure.
Object prop = message.getObjectProperty(SEND_CALL_NUMBER); Object prop = message.getObjectProperty(SEND_CALL_NUMBER);
if (prop == null) if (prop == null)
prop = Integer.valueOf(-1); prop = -1;
final int actual = message.getIntProperty("counter").intValue(); final int actual = message.getIntProperty("counter");
Assert.assertEquals("expected=" + i + ". Got: property['counter']=" + actual + " sendNumber=" + prop, i, actual); Assert.assertEquals("expected=" + i + ". Got: property['counter']=" + actual + " sendNumber=" + prop, i, actual);
assertMessageBody(i, message); assertMessageBody(i, message);
if (ack) if (ack)

View File

@ -172,7 +172,7 @@ public class AmqpSupport {
int port = 0; int port = 0;
try { try {
port = Integer.valueOf(info.get(PORT).toString()); port = Integer.parseInt(info.get(PORT).toString());
} catch (Exception ex) { } catch (Exception ex) {
result = new IOException(message + " : Redirection information not set."); result = new IOException(message + " : Redirection information not set.");
} }

View File

@ -121,7 +121,7 @@ public final class TypeConversionSupport {
Converter longConverter = new Converter() { Converter longConverter = new Converter() {
@Override @Override
public Object convert(Object value) { 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); CONVERSION_MAP.put(new ConversionKey(Byte.class, Long.class), longConverter);
@ -130,14 +130,14 @@ public final class TypeConversionSupport {
CONVERSION_MAP.put(new ConversionKey(Date.class, Long.class), new Converter() { CONVERSION_MAP.put(new ConversionKey(Date.class, Long.class), new Converter() {
@Override @Override
public Object convert(Object value) { public Object convert(Object value) {
return Long.valueOf(((Date) value).getTime()); return ((Date) value).getTime();
} }
}); });
Converter intConverter = new Converter() { Converter intConverter = new Converter() {
@Override @Override
public Object convert(Object value) { 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); CONVERSION_MAP.put(new ConversionKey(Byte.class, Integer.class), intConverter);
@ -146,14 +146,14 @@ public final class TypeConversionSupport {
CONVERSION_MAP.put(new ConversionKey(Byte.class, Short.class), new Converter() { CONVERSION_MAP.put(new ConversionKey(Byte.class, Short.class), new Converter() {
@Override @Override
public Object convert(Object value) { 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() { CONVERSION_MAP.put(new ConversionKey(Float.class, Double.class), new Converter() {
@Override @Override
public Object convert(Object value) { public Object convert(Object value) {
return Double.valueOf(((Number) value).doubleValue()); return ((Number) value).doubleValue();
} }
}); });
} }

View File

@ -1760,7 +1760,7 @@ public class PagingTest extends ParameterDBTestBase {
final HashMap<Integer, AtomicInteger> recordsType = countJournal(config); final HashMap<Integer, AtomicInteger> recordsType = countJournal(config);
assertNull("The system is acking page records instead of just delete data", recordsType.get(Integer.valueOf(JournalRecordIds.ACKNOWLEDGE_CURSOR))); assertNull("The system is acking page records instead of just delete data", recordsType.get((int) JournalRecordIds.ACKNOWLEDGE_CURSOR));
Pair<List<RecordInfo>, List<PreparedTransactionInfo>> journalData = loadMessageJournal(config); Pair<List<RecordInfo>, List<PreparedTransactionInfo>> journalData = loadMessageJournal(config);
@ -1771,13 +1771,13 @@ public class PagingTest extends ParameterDBTestBase {
DescribeJournal.ReferenceDescribe ref = (DescribeJournal.ReferenceDescribe) DescribeJournal.newObjectEncoding(info); DescribeJournal.ReferenceDescribe ref = (DescribeJournal.ReferenceDescribe) DescribeJournal.newObjectEncoding(info);
if (ref.refEncoding.queueID == deletedQueueID) { if (ref.refEncoding.queueID == deletedQueueID) {
deletedQueueReferences.add(Long.valueOf(info.id)); deletedQueueReferences.add(info.id);
} }
} else if (info.getUserRecordType() == JournalRecordIds.ACKNOWLEDGE_REF) { } else if (info.getUserRecordType() == JournalRecordIds.ACKNOWLEDGE_REF) {
AckDescribe ref = (AckDescribe) DescribeJournal.newObjectEncoding(info); AckDescribe ref = (AckDescribe) DescribeJournal.newObjectEncoding(info);
if (ref.refEncoding.queueID == deletedQueueID) { if (ref.refEncoding.queueID == deletedQueueID) {
deletedQueueReferences.remove(Long.valueOf(info.id)); deletedQueueReferences.remove(info.id);
} }
} }
} }

View File

@ -159,7 +159,7 @@ public class JMXManagementTest extends JMSClientTestSupport {
try { try {
UUID uuid = UUID.randomUUID(); UUID uuid = UUID.randomUUID();
Character character = Character.valueOf('C'); Character character = 'C';
AmqpSession session = connection.createSession(); AmqpSession session = connection.createSession();
AmqpSender sender = session.createSender(getQueueName()); AmqpSender sender = session.createSender(getQueueName());

View File

@ -286,7 +286,7 @@ public class AckManagerTest extends ActiveMQTestBase {
private int getCounter(byte typeRecord, HashMap<Integer, AtomicInteger> values) { private int getCounter(byte typeRecord, HashMap<Integer, AtomicInteger> values) {
AtomicInteger value = values.get(Integer.valueOf(typeRecord)); AtomicInteger value = values.get((int) typeRecord);
if (value == null) { if (value == null) {
return 0; return 0;
} else { } else {

View File

@ -307,7 +307,7 @@ public class SNFPagedMirrorTest extends ActiveMQTestBase {
} }
private int getCounter(byte typeRecord, HashMap<Integer, AtomicInteger> values) { private int getCounter(byte typeRecord, HashMap<Integer, AtomicInteger> values) {
AtomicInteger value = values.get(Integer.valueOf(typeRecord)); AtomicInteger value = values.get((int) typeRecord);
if (value == null) { if (value == null) {
return 0; return 0;
} else { } else {

View File

@ -160,7 +160,7 @@ public class LargeMessageCompressTest extends LargeMessageTest {
@Test @Test
public void testNoDirectByteBufLeaksOnLargeMessageCompression() throws Exception { public void testNoDirectByteBufLeaksOnLargeMessageCompression() throws Exception {
Assume.assumeThat(PlatformDependent.usedDirectMemory(), not(equalTo(Long.valueOf(-1)))); Assume.assumeThat(PlatformDependent.usedDirectMemory(), not(equalTo((long) -1)));
final int messageSize = (int) (3.5 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE); final int messageSize = (int) (3.5 * ActiveMQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
ActiveMQServer server = createServer(true, isNetty()); ActiveMQServer server = createServer(true, isNetty());

View File

@ -556,10 +556,10 @@ public class BridgeReconnectTest extends BridgeTestBase {
HashMap<Integer, AtomicInteger> counts = countJournal(server1.getConfiguration()); HashMap<Integer, AtomicInteger> counts = countJournal(server1.getConfiguration());
if (persistCache) { if (persistCache) {
// There should be one record per message // There should be one record per message
Assert.assertEquals(numMessages, counts.get(Integer.valueOf(JournalRecordIds.DUPLICATE_ID)).intValue()); Assert.assertEquals(numMessages, counts.get((int) JournalRecordIds.DUPLICATE_ID).intValue());
} else { } else {
// no cache means there shouldn't be an id anywhere // no cache means there shouldn't be an id anywhere
Assert.assertNull(counts.get(Integer.valueOf(JournalRecordIds.DUPLICATE_ID))); Assert.assertNull(counts.get((int) JournalRecordIds.DUPLICATE_ID));
} }
} }

View File

@ -1508,7 +1508,7 @@ public class BridgeTest extends ActiveMQTestBase {
} }
for (int i = 0; i < numMessages; i++) { for (int i = 0; i < numMessages; i++) {
AtomicInteger msgCount = receivedMsg.get(Integer.valueOf(i)); AtomicInteger msgCount = receivedMsg.get(i);
if (msgCount == null) { if (msgCount == null) {
System.err.println("Msg " + i + " wasn't received"); System.err.println("Msg " + i + " wasn't received");
failed = true; failed = true;

View File

@ -140,7 +140,7 @@ public class PagedSNFTopicDistributionTest extends ClusterTestBase {
} }
private int getCounter(byte typeRecord, HashMap<Integer, AtomicInteger> values) { private int getCounter(byte typeRecord, HashMap<Integer, AtomicInteger> values) {
AtomicInteger value = values.get(Integer.valueOf(typeRecord)); AtomicInteger value = values.get((int) typeRecord);
if (value == null) { if (value == null) {
return 0; return 0;
} else { } else {

View File

@ -102,7 +102,7 @@ public class RequestReplyNonJMSTest extends OpenWireTestBase {
AmqpMessage message = new AmqpMessage(); AmqpMessage message = new AmqpMessage();
message = new AmqpMessage(); message = new AmqpMessage();
message.setReplyToAddress(replyQueue.toString()); message.setReplyToAddress(replyQueue.toString());
message.setMessageAnnotation("x-opt-jms-reply-to", Byte.valueOf((byte)10)); // that's invalid on the conversion, lets hope it doesn't fail message.setMessageAnnotation("x-opt-jms-reply-to", (byte) 10); // that's invalid on the conversion, lets hope it doesn't fail
message.setMessageId("msg-1"); message.setMessageId("msg-1");
sender.send(message); sender.send(message);
@ -201,7 +201,7 @@ public class RequestReplyNonJMSTest extends OpenWireTestBase {
AmqpMessage message = new AmqpMessage(); AmqpMessage message = new AmqpMessage();
message.setReplyToAddress(replyQueue.toString()); message.setReplyToAddress(replyQueue.toString());
message.setMessageId("msg-1"); message.setMessageId("msg-1");
message.setMessageAnnotation("x-opt-not-jms-reply-to", Byte.valueOf((byte)1)); message.setMessageAnnotation("x-opt-not-jms-reply-to", (byte) 1);
message.setText("Test-Message"); message.setText("Test-Message");
sender.send(message); sender.send(message);
@ -251,7 +251,7 @@ public class RequestReplyNonJMSTest extends OpenWireTestBase {
AmqpMessage message = new AmqpMessage(); AmqpMessage message = new AmqpMessage();
message.setReplyToAddress(replyQueue.toString()); message.setReplyToAddress(replyQueue.toString());
message.setMessageId("msg-1"); message.setMessageId("msg-1");
message.setMessageAnnotation("x-opt-jms-reply-to", Byte.valueOf((byte)0)); message.setMessageAnnotation("x-opt-jms-reply-to", (byte) 0);
message.setText("Test-Message"); message.setText("Test-Message");
sender.send(message); sender.send(message);
@ -301,7 +301,7 @@ public class RequestReplyNonJMSTest extends OpenWireTestBase {
AmqpMessage message = new AmqpMessage(); AmqpMessage message = new AmqpMessage();
message.setReplyToAddress(topicName.toString()); message.setReplyToAddress(topicName.toString());
message.setMessageId("msg-1"); message.setMessageId("msg-1");
message.setMessageAnnotation("x-opt-jms-reply-to", Byte.valueOf((byte)1)); message.setMessageAnnotation("x-opt-jms-reply-to", (byte) 1);
message.setText("Test-Message"); message.setText("Test-Message");
sender.send(message); sender.send(message);
@ -353,7 +353,7 @@ public class RequestReplyNonJMSTest extends OpenWireTestBase {
AmqpMessage message = new AmqpMessage(); AmqpMessage message = new AmqpMessage();
message.setReplyToAddress(replyToName); message.setReplyToAddress(replyToName);
message.setMessageId("msg-1"); message.setMessageId("msg-1");
message.setMessageAnnotation("x-opt-jms-reply-to", Byte.valueOf((byte)3)); message.setMessageAnnotation("x-opt-jms-reply-to", (byte) 3);
message.setText("Test-Message"); message.setText("Test-Message");
sender.send(message); sender.send(message);
@ -404,7 +404,7 @@ public class RequestReplyNonJMSTest extends OpenWireTestBase {
AmqpMessage message = new AmqpMessage(); AmqpMessage message = new AmqpMessage();
message.setReplyToAddress(replyToName); message.setReplyToAddress(replyToName);
message.setMessageId("msg-1"); message.setMessageId("msg-1");
message.setMessageAnnotation("x-opt-jms-reply-to", Byte.valueOf((byte)2)); message.setMessageAnnotation("x-opt-jms-reply-to", (byte) 2);
message.setText("Test-Message"); message.setText("Test-Message");
sender.send(message); sender.send(message);

View File

@ -228,7 +228,7 @@ public class JDBCJournalTest extends ActiveMQTestBase {
int noTxRecords = 100; int noTxRecords = 100;
for (int i = 1000; i < 1000 + noTx; i++) { for (int i = 1000; i < 1000 + noTx; i++) {
for (int j = 0; j < noTxRecords; j++) { for (int j = 0; j < noTxRecords; j++) {
journal.appendAddRecordTransactional(i, Long.valueOf(i + "" + j), (byte) 1, new byte[0]); journal.appendAddRecordTransactional(i, Long.parseLong(i + "" + j), (byte) 1, new byte[0]);
} }
journal.appendPrepareRecord(i, new byte[0], true); journal.appendPrepareRecord(i, new byte[0], true);
journal.appendCommitRecord(i, true); journal.appendCommitRecord(i, true);

View File

@ -1390,7 +1390,7 @@ public class PublishTests extends MQTT5TestSupport {
} }
@Override @Override
public void messageArrived(String topic, MqttMessage message) throws Exception { public void messageArrived(String topic, MqttMessage message) throws Exception {
int sentAs = Integer.valueOf(new String(message.getPayload(), StandardCharsets.UTF_8)); int sentAs = Integer.parseInt(new String(message.getPayload(), StandardCharsets.UTF_8));
logger.info("QoS of publish: {}; QoS of subscription: {}; QoS of receive: {}", sentAs, qosOfSubscription, message.getQos()); logger.info("QoS of publish: {}; QoS of subscription: {}; QoS of receive: {}", sentAs, qosOfSubscription, message.getQos());
if (sentAs == 0) { if (sentAs == 0) {
assertTrue(message.getQos() == 0); assertTrue(message.getQos() == 0);

View File

@ -101,9 +101,9 @@ public class GeneralInteropTest extends BasicOpenWireTest {
assertEquals((byte) 5, bytes[1]); assertEquals((byte) 5, bytes[1]);
assertEquals('a', mapMessage.getChar("achar")); assertEquals('a', mapMessage.getChar("achar"));
Double doubleVal = mapMessage.getDouble("adouble"); Double doubleVal = mapMessage.getDouble("adouble");
assertTrue(doubleVal.equals(Double.valueOf(4.4))); assertTrue(doubleVal.equals(4.4));
Float floatVal = mapMessage.getFloat("afloat"); Float floatVal = mapMessage.getFloat("afloat");
assertTrue(floatVal.equals(Float.valueOf(4.5F))); assertTrue(floatVal.equals(4.5F));
assertEquals(40, mapMessage.getInt("aint")); assertEquals(40, mapMessage.getInt("aint"));
assertEquals(80L, mapMessage.getLong("along")); assertEquals(80L, mapMessage.getLong("along"));
assertEquals(65, mapMessage.getShort("ashort")); assertEquals(65, mapMessage.getShort("ashort"));
@ -138,9 +138,9 @@ public class GeneralInteropTest extends BasicOpenWireTest {
assertEquals('b', streamMessage.readChar()); assertEquals('b', streamMessage.readChar());
Double streamDouble = streamMessage.readDouble(); Double streamDouble = streamMessage.readDouble();
assertTrue(streamDouble.equals(Double.valueOf(6.5))); assertTrue(streamDouble.equals(6.5));
Float streamFloat = streamMessage.readFloat(); Float streamFloat = streamMessage.readFloat();
assertTrue(streamFloat.equals(Float.valueOf(93.9F))); assertTrue(streamFloat.equals(93.9F));
assertEquals(7657, streamMessage.readInt()); assertEquals(7657, streamMessage.readInt());
assertEquals(239999L, streamMessage.readLong()); assertEquals(239999L, streamMessage.readLong());
assertEquals((short) 34222, streamMessage.readShort()); assertEquals((short) 34222, streamMessage.readShort());
@ -627,9 +627,9 @@ public class GeneralInteropTest extends BasicOpenWireTest {
assertEquals((byte) 5, bytes[1]); assertEquals((byte) 5, bytes[1]);
assertEquals('a', mapMessage.getChar("achar")); assertEquals('a', mapMessage.getChar("achar"));
Double doubleVal = mapMessage.getDouble("adouble"); Double doubleVal = mapMessage.getDouble("adouble");
assertTrue(doubleVal.equals(Double.valueOf(4.4))); assertTrue(doubleVal.equals(4.4));
Float floatVal = mapMessage.getFloat("afloat"); Float floatVal = mapMessage.getFloat("afloat");
assertTrue(floatVal.equals(Float.valueOf(4.5F))); assertTrue(floatVal.equals(4.5F));
assertEquals(40, mapMessage.getInt("aint")); assertEquals(40, mapMessage.getInt("aint"));
assertEquals(80L, mapMessage.getLong("along")); assertEquals(80L, mapMessage.getLong("along"));
assertEquals(65, mapMessage.getShort("ashort")); assertEquals(65, mapMessage.getShort("ashort"));
@ -666,9 +666,9 @@ public class GeneralInteropTest extends BasicOpenWireTest {
assertEquals('b', streamMessage.readChar()); assertEquals('b', streamMessage.readChar());
Double streamDouble = streamMessage.readDouble(); Double streamDouble = streamMessage.readDouble();
assertTrue(streamDouble.equals(Double.valueOf(6.5))); assertTrue(streamDouble.equals(6.5));
Float streamFloat = streamMessage.readFloat(); Float streamFloat = streamMessage.readFloat();
assertTrue(streamFloat.equals(Float.valueOf(93.9F))); assertTrue(streamFloat.equals(93.9F));
assertEquals(7657, streamMessage.readInt()); assertEquals(7657, streamMessage.readInt());
assertEquals(239999L, streamMessage.readLong()); assertEquals(239999L, streamMessage.readLong());
assertEquals((short) 34222, streamMessage.readShort()); assertEquals((short) 34222, streamMessage.readShort());

View File

@ -121,7 +121,7 @@ public class XmlImportExportTest extends ActiveMQTestBase {
ClientMessage msg = session.createMessage(true); ClientMessage msg = session.createMessage(true);
msg.getBodyBuffer().writeString("Bob the giant pig " + i); msg.getBodyBuffer().writeString("Bob the giant pig " + i);
msg.putBooleanProperty("myBooleanProperty", Boolean.TRUE); msg.putBooleanProperty("myBooleanProperty", Boolean.TRUE);
msg.putByteProperty("myByteProperty", Byte.valueOf("0")); msg.putByteProperty("myByteProperty", Byte.parseByte("0"));
msg.putBytesProperty("myBytesProperty", new byte[]{0, 1, 2, 3, 4}); msg.putBytesProperty("myBytesProperty", new byte[]{0, 1, 2, 3, 4});
msg.putDoubleProperty("myDoubleProperty", i * 1.6); msg.putDoubleProperty("myDoubleProperty", i * 1.6);
msg.putFloatProperty("myFloatProperty", i * 2.5F); msg.putFloatProperty("myFloatProperty", i * 2.5F);

View File

@ -258,7 +258,7 @@ public class MetricsPluginTest extends ActiveMQTestBase {
} }
Wait.assertEquals(messageCount, server.locateQueue(queueName)::getMessageCount, 2000, 100); Wait.assertEquals(messageCount, server.locateQueue(queueName)::getMessageCount, 2000, 100);
checkMetric(getMetrics(), "artemis.message.count", "queue", queueName, Double.valueOf(messageCount)); checkMetric(getMetrics(), "artemis.message.count", "queue", queueName, (double) messageCount);
for (int i = 0; i < messageCount; i++) { for (int i = 0; i < messageCount; i++) {
producer.send(message); producer.send(message);
@ -266,7 +266,7 @@ public class MetricsPluginTest extends ActiveMQTestBase {
producer.close(); producer.close();
Wait.assertEquals(messageCount * 2, server.locateQueue(queueName)::getMessageCount, 2000, 100); Wait.assertEquals(messageCount * 2, server.locateQueue(queueName)::getMessageCount, 2000, 100);
checkMetric(getMetrics(), "artemis.message.count", "queue", queueName, Double.valueOf(messageCount * 2)); checkMetric(getMetrics(), "artemis.message.count", "queue", queueName, (double) (messageCount * 2));
} }
@Test @Test

View File

@ -299,7 +299,7 @@ public final class ReplicationTest extends ActiveMQTestBase {
manager.largeMessageWrite(500, new byte[1024]); manager.largeMessageWrite(500, new byte[1024]);
manager.largeMessageDelete(Long.valueOf(500), storage); manager.largeMessageDelete(500L, storage);
blockOnReplication(storage, manager); blockOnReplication(storage, manager);
@ -580,7 +580,7 @@ public final class ReplicationTest extends ActiveMQTestBase {
blockOnReplication(storage, manager); blockOnReplication(storage, manager);
LargeServerMessageImpl message1 = (LargeServerMessageImpl) getReplicationEndpoint(backupServer).getLargeMessages().get(Long.valueOf(500)); LargeServerMessageImpl message1 = (LargeServerMessageImpl) getReplicationEndpoint(backupServer).getLargeMessages().get(500L);
Assert.assertNotNull(message1); Assert.assertNotNull(message1);
Assert.assertFalse(largeMsg.getAppendFile().isOpen()); Assert.assertFalse(largeMsg.getAppendFile().isOpen());

View File

@ -522,7 +522,7 @@ public class ScaleDownTest extends ClusterTestBase {
ClientMessage msg = session.createMessage(true); ClientMessage msg = session.createMessage(true);
msg.getBodyBuffer().writeString("Bob the giant pig " + i); msg.getBodyBuffer().writeString("Bob the giant pig " + i);
msg.putBooleanProperty("myBooleanProperty", Boolean.TRUE); msg.putBooleanProperty("myBooleanProperty", Boolean.TRUE);
msg.putByteProperty("myByteProperty", Byte.valueOf("0")); msg.putByteProperty("myByteProperty", Byte.parseByte("0"));
msg.putBytesProperty("myBytesProperty", new byte[]{0, 1, 2, 3, 4}); msg.putBytesProperty("myBytesProperty", new byte[]{0, 1, 2, 3, 4});
msg.putDoubleProperty("myDoubleProperty", i * 1.6); msg.putDoubleProperty("myDoubleProperty", i * 1.6);
msg.putFloatProperty("myFloatProperty", i * 2.5F); msg.putFloatProperty("myFloatProperty", i * 2.5F);

View File

@ -128,8 +128,8 @@ public class BodyIsAssignableFromTest extends MessageBodyTestCase {
msg = queueProducerSession.createStreamMessage(); msg = queueProducerSession.createStreamMessage();
break; break;
case OBJECT: case OBJECT:
res = Double.valueOf(37.6); res = 37.6;
msg = queueProducerSession.createObjectMessage(Double.valueOf(37.6)); msg = queueProducerSession.createObjectMessage(37.6);
break; break;
case MAP: case MAP:
MapMessage msg1 = queueProducerSession.createMapMessage(); MapMessage msg1 = queueProducerSession.createMapMessage();
@ -138,8 +138,8 @@ public class BodyIsAssignableFromTest extends MessageBodyTestCase {
msg1.setString("string", "crocodile"); msg1.setString("string", "crocodile");
msg = msg1; msg = msg1;
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("int", Integer.valueOf(13)); map.put("int", 13);
map.put("long", Long.valueOf(37L)); map.put("long", 37L);
map.put("string", "crocodile"); map.put("string", "crocodile");
res = map; res = map;
break; break;

View File

@ -80,8 +80,8 @@ public class BytesMessageTest extends MessageTestBase {
ProxyAssertSupport.assertEquals((byte) 5, bytes[1]); ProxyAssertSupport.assertEquals((byte) 5, bytes[1]);
ProxyAssertSupport.assertEquals((byte) 6, bytes[2]); ProxyAssertSupport.assertEquals((byte) 6, bytes[2]);
ProxyAssertSupport.assertEquals((char) 7, bm.readChar()); ProxyAssertSupport.assertEquals((char) 7, bm.readChar());
ProxyAssertSupport.assertEquals(Double.valueOf(8.0), Double.valueOf(bm.readDouble())); ProxyAssertSupport.assertEquals(8.0, bm.readDouble());
ProxyAssertSupport.assertEquals(Float.valueOf(9.0f), Float.valueOf(bm.readFloat())); ProxyAssertSupport.assertEquals(9.0f, bm.readFloat());
ProxyAssertSupport.assertEquals(10, bm.readInt()); ProxyAssertSupport.assertEquals(10, bm.readInt());
ProxyAssertSupport.assertEquals(11L, bm.readLong()); ProxyAssertSupport.assertEquals(11L, bm.readLong());
ProxyAssertSupport.assertEquals((short) 12, bm.readShort()); ProxyAssertSupport.assertEquals((short) 12, bm.readShort());

View File

@ -96,8 +96,8 @@ public class MapMessageTest extends MessageTestBase {
ProxyAssertSupport.assertEquals((byte) 4, bytes[1]); ProxyAssertSupport.assertEquals((byte) 4, bytes[1]);
ProxyAssertSupport.assertEquals((byte) 5, bytes[2]); ProxyAssertSupport.assertEquals((byte) 5, bytes[2]);
ProxyAssertSupport.assertEquals((char) 6, mm.getChar("char")); ProxyAssertSupport.assertEquals((char) 6, mm.getChar("char"));
ProxyAssertSupport.assertEquals(Double.valueOf(7.0), Double.valueOf(mm.getDouble("double"))); ProxyAssertSupport.assertEquals(7.0, mm.getDouble("double"));
ProxyAssertSupport.assertEquals(Float.valueOf(8.0f), Float.valueOf(mm.getFloat("float"))); ProxyAssertSupport.assertEquals(8.0f, mm.getFloat("float"));
ProxyAssertSupport.assertEquals(9, mm.getInt("int")); ProxyAssertSupport.assertEquals(9, mm.getInt("int"));
ProxyAssertSupport.assertEquals(10L, mm.getLong("long")); ProxyAssertSupport.assertEquals(10L, mm.getLong("long"));
ProxyAssertSupport.assertEquals("this is an object", mm.getObject("object")); ProxyAssertSupport.assertEquals("this is an object", mm.getObject("object"));

View File

@ -81,13 +81,13 @@ public class MessageBodyTest extends MessageBodyTestCase {
m.writeBytes(myBytes); m.writeBytes(myBytes);
m.writeBytes(myBytes, 2, 3); m.writeBytes(myBytes, 2, 3);
m.writeObject(Boolean.valueOf(myBool)); m.writeObject(myBool);
m.writeObject(Byte.valueOf(myByte)); m.writeObject(myByte);
m.writeObject(Short.valueOf(myShort)); m.writeObject(myShort);
m.writeObject(Integer.valueOf(myInt)); m.writeObject(myInt);
m.writeObject(Long.valueOf(myLong)); m.writeObject(myLong);
m.writeObject(Float.valueOf(myFloat)); m.writeObject(myFloat);
m.writeObject(Double.valueOf(myDouble)); m.writeObject(myDouble);
m.writeObject(myString); m.writeObject(myString);
m.writeObject(myBytes); m.writeObject(myBytes);
@ -439,13 +439,13 @@ public class MessageBodyTest extends MessageBodyTestCase {
m1.setDouble("myDouble", myDouble); m1.setDouble("myDouble", myDouble);
m1.setString("myString", myString); m1.setString("myString", myString);
m1.setObject("myBool", Boolean.valueOf(myBool)); m1.setObject("myBool", myBool);
m1.setObject("myByte", Byte.valueOf(myByte)); m1.setObject("myByte", myByte);
m1.setObject("myShort", Short.valueOf(myShort)); m1.setObject("myShort", myShort);
m1.setObject("myInt", Integer.valueOf(myInt)); m1.setObject("myInt", myInt);
m1.setObject("myLong", Long.valueOf(myLong)); m1.setObject("myLong", myLong);
m1.setObject("myFloat", Float.valueOf(myFloat)); m1.setObject("myFloat", myFloat);
m1.setObject("myDouble", Double.valueOf(myDouble)); m1.setObject("myDouble", myDouble);
m1.setObject("myString", myString); m1.setObject("myString", myString);
try { try {
@ -943,13 +943,13 @@ public class MessageBodyTest extends MessageBodyTestCase {
m.writeBytes(myBytes); m.writeBytes(myBytes);
m.writeBytes(myBytes, 2, 3); m.writeBytes(myBytes, 2, 3);
m.writeObject(Boolean.valueOf(myBool)); m.writeObject(myBool);
m.writeObject(Byte.valueOf(myByte)); m.writeObject(myByte);
m.writeObject(Short.valueOf(myShort)); m.writeObject(myShort);
m.writeObject(Integer.valueOf(myInt)); m.writeObject(myInt);
m.writeObject(Long.valueOf(myLong)); m.writeObject(myLong);
m.writeObject(Float.valueOf(myFloat)); m.writeObject(myFloat);
m.writeObject(Double.valueOf(myDouble)); m.writeObject(myDouble);
m.writeObject(myString); m.writeObject(myString);
m.writeObject(myBytes); m.writeObject(myBytes);

View File

@ -176,13 +176,13 @@ public class MessageHeaderTest extends MessageHeaderTestBase {
m1.setDoubleProperty("myDouble", myDouble); m1.setDoubleProperty("myDouble", myDouble);
m1.setStringProperty("myString", myString); m1.setStringProperty("myString", myString);
m1.setObjectProperty("myBool", Boolean.valueOf(myBool)); m1.setObjectProperty("myBool", myBool);
m1.setObjectProperty("myByte", Byte.valueOf(myByte)); m1.setObjectProperty("myByte", myByte);
m1.setObjectProperty("myShort", Short.valueOf(myShort)); m1.setObjectProperty("myShort", myShort);
m1.setObjectProperty("myInt", Integer.valueOf(myInt)); m1.setObjectProperty("myInt", myInt);
m1.setObjectProperty("myLong", Long.valueOf(myLong)); m1.setObjectProperty("myLong", myLong);
m1.setObjectProperty("myFloat", Float.valueOf(myFloat)); m1.setObjectProperty("myFloat", myFloat);
m1.setObjectProperty("myDouble", Double.valueOf(myDouble)); m1.setObjectProperty("myDouble", myDouble);
m1.setObjectProperty("myString", myString); m1.setObjectProperty("myString", myString);
try { try {

View File

@ -241,7 +241,7 @@ public class MessagePropertyConversionTest extends ActiveMQServerTestCase {
String myByte = producer.getStringProperty("abyte"); String myByte = producer.getStringProperty("abyte");
if (Byte.valueOf(myByte).byteValue() != bValue) { if (Byte.parseByte(myByte) != bValue) {
ProxyAssertSupport.fail("conversion from byte to string failed"); ProxyAssertSupport.fail("conversion from byte to string failed");
} }
@ -289,7 +289,7 @@ public class MessagePropertyConversionTest extends ActiveMQServerTestCase {
String myshort = producer.getStringProperty("ashort"); String myshort = producer.getStringProperty("ashort");
if (Short.valueOf(myshort).shortValue() != nShort) { if (Short.parseShort(myshort) != nShort) {
ProxyAssertSupport.fail("conversion from short to string failed"); ProxyAssertSupport.fail("conversion from short to string failed");
} }
@ -344,7 +344,7 @@ public class MessagePropertyConversionTest extends ActiveMQServerTestCase {
} }
if (Integer.valueOf(producer.getStringProperty("anint")).intValue() != nInt) { if (Integer.parseInt(producer.getStringProperty("anint")) != nInt) {
ProxyAssertSupport.fail("conversion from int to string failed"); ProxyAssertSupport.fail("conversion from int to string failed");
} }
@ -400,7 +400,7 @@ public class MessagePropertyConversionTest extends ActiveMQServerTestCase {
ProxyAssertSupport.fail("Caught unexpected exception: " + ee); ProxyAssertSupport.fail("Caught unexpected exception: " + ee);
} }
if (Long.valueOf(producer.getStringProperty("along")).longValue() != nLong) { if (Long.parseLong(producer.getStringProperty("along")) != nLong) {
ProxyAssertSupport.fail("conversion from long to string failed"); ProxyAssertSupport.fail("conversion from long to string failed");
} }
@ -458,7 +458,7 @@ public class MessagePropertyConversionTest extends ActiveMQServerTestCase {
ProxyAssertSupport.fail("Caught unexpected exception: " + ee); ProxyAssertSupport.fail("Caught unexpected exception: " + ee);
} }
if (Float.valueOf(producer.getStringProperty("afloat")).floatValue() != nFloat) { if (Float.parseFloat(producer.getStringProperty("afloat")) != nFloat) {
ProxyAssertSupport.fail("conversion from float to string failed"); ProxyAssertSupport.fail("conversion from float to string failed");
} }
@ -512,7 +512,7 @@ public class MessagePropertyConversionTest extends ActiveMQServerTestCase {
ProxyAssertSupport.fail("Caught unexpected exception: " + ee); ProxyAssertSupport.fail("Caught unexpected exception: " + ee);
} }
if (Double.valueOf(producer.getStringProperty("adouble")).doubleValue() != nDouble) { if (Double.parseDouble(producer.getStringProperty("adouble")) != nDouble) {
ProxyAssertSupport.fail("conversion from double to string failed"); ProxyAssertSupport.fail("conversion from double to string failed");
} }

View File

@ -194,8 +194,8 @@ public abstract class MessageTestBase extends ActiveMQServerTestCase {
ProxyAssertSupport.assertNotNull(m); ProxyAssertSupport.assertNotNull(m);
ProxyAssertSupport.assertEquals(true, m.getBooleanProperty("booleanProperty")); ProxyAssertSupport.assertEquals(true, m.getBooleanProperty("booleanProperty"));
ProxyAssertSupport.assertEquals((byte) 3, m.getByteProperty("byteProperty")); ProxyAssertSupport.assertEquals((byte) 3, m.getByteProperty("byteProperty"));
ProxyAssertSupport.assertEquals(Double.valueOf(4.0), Double.valueOf(m.getDoubleProperty("doubleProperty"))); ProxyAssertSupport.assertEquals(4.0, m.getDoubleProperty("doubleProperty"));
ProxyAssertSupport.assertEquals(Float.valueOf(5.0f), Float.valueOf(m.getFloatProperty("floatProperty"))); ProxyAssertSupport.assertEquals(5.0f, m.getFloatProperty("floatProperty"));
ProxyAssertSupport.assertEquals(6, m.getIntProperty("intProperty")); ProxyAssertSupport.assertEquals(6, m.getIntProperty("intProperty"));
ProxyAssertSupport.assertEquals(7, m.getLongProperty("longProperty")); ProxyAssertSupport.assertEquals(7, m.getLongProperty("longProperty"));
ProxyAssertSupport.assertEquals((short) 8, m.getShortProperty("shortProperty")); ProxyAssertSupport.assertEquals((short) 8, m.getShortProperty("shortProperty"));

View File

@ -46,7 +46,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Boolean.valueOf(value)); content.put(name, value);
} }
@ -57,7 +57,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Byte.valueOf(value)); content.put(name, value);
} }
@ -68,7 +68,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Short.valueOf(value)); content.put(name, value);
} }
@ -79,7 +79,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Character.valueOf(value)); content.put(name, value);
} }
@ -90,7 +90,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Integer.valueOf(value)); content.put(name, value);
} }
@ -101,7 +101,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Long.valueOf(value)); content.put(name, value);
} }
@ -112,7 +112,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Float.valueOf(value)); content.put(name, value);
} }
@ -123,7 +123,7 @@ public class SimpleJMSMapMessage extends SimpleJMSMessage implements MapMessage
throw new MessageNotWriteableException("Message is ReadOnly !"); throw new MessageNotWriteableException("Message is ReadOnly !");
} }
content.put(name, Double.valueOf(value)); content.put(name, value);
} }

View File

@ -35,7 +35,7 @@ public class SimpleJMSMessage implements Message {
public SimpleJMSMessage() { public SimpleJMSMessage() {
properties.put("JMSXDeliveryCount", Integer.valueOf(0)); properties.put("JMSXDeliveryCount", 0);
} }
/* /*
@ -216,7 +216,7 @@ public class SimpleJMSMessage implements Message {
if (!(prop instanceof Boolean)) { if (!(prop instanceof Boolean)) {
throw new JMSException("Not boolean"); throw new JMSException("Not boolean");
} }
return ((Boolean) properties.get(name)).booleanValue(); return (Boolean) properties.get(name);
} }
@Override @Override
@ -225,7 +225,7 @@ public class SimpleJMSMessage implements Message {
if (!(prop instanceof Byte)) { if (!(prop instanceof Byte)) {
throw new JMSException("Not byte"); throw new JMSException("Not byte");
} }
return ((Byte) properties.get(name)).byteValue(); return (Byte) properties.get(name);
} }
@Override @Override
@ -234,7 +234,7 @@ public class SimpleJMSMessage implements Message {
if (!(prop instanceof Short)) { if (!(prop instanceof Short)) {
throw new JMSException("Not short"); throw new JMSException("Not short");
} }
return ((Short) properties.get(name)).shortValue(); return (Short) properties.get(name);
} }
@Override @Override
@ -243,7 +243,7 @@ public class SimpleJMSMessage implements Message {
if (!(prop instanceof Integer)) { if (!(prop instanceof Integer)) {
throw new JMSException("Not int"); throw new JMSException("Not int");
} }
return ((Integer) properties.get(name)).intValue(); return (Integer) properties.get(name);
} }
@Override @Override
@ -252,7 +252,7 @@ public class SimpleJMSMessage implements Message {
if (!(prop instanceof Long)) { if (!(prop instanceof Long)) {
throw new JMSException("Not long"); throw new JMSException("Not long");
} }
return ((Long) properties.get(name)).longValue(); return (Long) properties.get(name);
} }
@Override @Override
@ -261,7 +261,7 @@ public class SimpleJMSMessage implements Message {
if (!(prop instanceof Float)) { if (!(prop instanceof Float)) {
throw new JMSException("Not float"); throw new JMSException("Not float");
} }
return ((Float) properties.get(name)).floatValue(); return (Float) properties.get(name);
} }
@Override @Override
@ -270,7 +270,7 @@ public class SimpleJMSMessage implements Message {
if (!(prop instanceof Double)) { if (!(prop instanceof Double)) {
throw new JMSException("Not double"); throw new JMSException("Not double");
} }
return ((Double) properties.get(name)).doubleValue(); return (Double) properties.get(name);
} }
@Override @Override
@ -299,32 +299,32 @@ public class SimpleJMSMessage implements Message {
@Override @Override
public void setByteProperty(final String name, final byte value) throws JMSException { public void setByteProperty(final String name, final byte value) throws JMSException {
properties.put(name, Byte.valueOf(value)); properties.put(name, value);
} }
@Override @Override
public void setShortProperty(final String name, final short value) throws JMSException { public void setShortProperty(final String name, final short value) throws JMSException {
properties.put(name, Short.valueOf(value)); properties.put(name, value);
} }
@Override @Override
public void setIntProperty(final String name, final int value) throws JMSException { public void setIntProperty(final String name, final int value) throws JMSException {
properties.put(name, Integer.valueOf(value)); properties.put(name, value);
} }
@Override @Override
public void setLongProperty(final String name, final long value) throws JMSException { public void setLongProperty(final String name, final long value) throws JMSException {
properties.put(name, Long.valueOf(value)); properties.put(name, value);
} }
@Override @Override
public void setFloatProperty(final String name, final float value) throws JMSException { public void setFloatProperty(final String name, final float value) throws JMSException {
properties.put(name, Float.valueOf(value)); properties.put(name, value);
} }
@Override @Override
public void setDoubleProperty(final String name, final double value) throws JMSException { public void setDoubleProperty(final String name, final double value) throws JMSException {
properties.put(name, Double.valueOf(value)); properties.put(name, value);
} }
@Override @Override

View File

@ -391,7 +391,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Boolean.valueOf(value)); content.add(value);
} }
@Override @Override
@ -399,7 +399,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Byte.valueOf(value)); content.add(value);
} }
@Override @Override
@ -407,7 +407,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Short.valueOf(value)); content.add(value);
} }
@Override @Override
@ -415,7 +415,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Character.valueOf(value)); content.add(value);
} }
@Override @Override
@ -423,7 +423,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Integer.valueOf(value)); content.add(value);
} }
@Override @Override
@ -431,7 +431,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Long.valueOf(value)); content.add(value);
} }
@Override @Override
@ -439,7 +439,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Float.valueOf(value)); content.add(value);
} }
@Override @Override
@ -447,7 +447,7 @@ public class SimpleJMSStreamMessage extends SimpleJMSMessage implements StreamMe
if (!bodyWriteOnly) { if (!bodyWriteOnly) {
throw new MessageNotWriteableException("The message body is readonly"); throw new MessageNotWriteableException("The message body is readonly");
} }
content.add(Double.valueOf(value)); content.add(value);
} }
@Override @Override

View File

@ -98,8 +98,8 @@ public class StreamMessageTest extends MessageTestBase {
ProxyAssertSupport.assertEquals((byte) 6, bytes[2]); ProxyAssertSupport.assertEquals((byte) 6, bytes[2]);
ProxyAssertSupport.assertEquals(-1, sm.readBytes(bytes)); ProxyAssertSupport.assertEquals(-1, sm.readBytes(bytes));
ProxyAssertSupport.assertEquals((char) 7, sm.readChar()); ProxyAssertSupport.assertEquals((char) 7, sm.readChar());
ProxyAssertSupport.assertEquals(Double.valueOf(8.0), Double.valueOf(sm.readDouble())); ProxyAssertSupport.assertEquals(8.0, sm.readDouble());
ProxyAssertSupport.assertEquals(Float.valueOf(9.0f), Float.valueOf(sm.readFloat())); ProxyAssertSupport.assertEquals(9.0f, sm.readFloat());
ProxyAssertSupport.assertEquals(10, sm.readInt()); ProxyAssertSupport.assertEquals(10, sm.readInt());
ProxyAssertSupport.assertEquals(11L, sm.readLong()); ProxyAssertSupport.assertEquals(11L, sm.readLong());
ProxyAssertSupport.assertEquals("this is an object", sm.readObject()); ProxyAssertSupport.assertEquals("this is an object", sm.readObject());

View File

@ -81,12 +81,12 @@ public class InVMInitialContextFactory implements InitialContextFactory {
// Note! This MUST be synchronized // Note! This MUST be synchronized
synchronized (InVMInitialContextFactory.initialContexts) { synchronized (InVMInitialContextFactory.initialContexts) {
InVMContext ic = (InVMContext) InVMInitialContextFactory.initialContexts.get(Integer.valueOf(serverIndex)); InVMContext ic = (InVMContext) InVMInitialContextFactory.initialContexts.get(serverIndex);
if (ic == null) { if (ic == null) {
ic = new InVMContext(s); ic = new InVMContext(s);
ic.bind("java:/", new InVMContext(s)); ic.bind("java:/", new InVMContext(s));
InVMInitialContextFactory.initialContexts.put(Integer.valueOf(serverIndex), ic); InVMInitialContextFactory.initialContexts.put(serverIndex, ic);
} }
return ic; return ic;

View File

@ -44,7 +44,7 @@ public class JNDIUtilTest extends ActiveMQServerTestCase {
// OK // OK
} }
JNDIUtil.rebind(ic, "/nosuchsubcontext/sub1/sub2/sub3/name", Integer.valueOf(7)); JNDIUtil.rebind(ic, "/nosuchsubcontext/sub1/sub2/sub3/name", 7);
ProxyAssertSupport.assertEquals(7, ((Integer) ic.lookup("/nosuchsubcontext/sub1/sub2/sub3/name")).intValue()); ProxyAssertSupport.assertEquals(7, ((Integer) ic.lookup("/nosuchsubcontext/sub1/sub2/sub3/name")).intValue());
} }
@ -58,7 +58,7 @@ public class JNDIUtilTest extends ActiveMQServerTestCase {
// OK // OK
} }
JNDIUtil.rebind(ic, "/doesnotexistyet", Integer.valueOf(8)); JNDIUtil.rebind(ic, "/doesnotexistyet", 8);
ProxyAssertSupport.assertEquals(8, ((Integer) ic.lookup("/doesnotexistyet")).intValue()); ProxyAssertSupport.assertEquals(8, ((Integer) ic.lookup("/doesnotexistyet")).intValue());
@ -74,7 +74,7 @@ public class JNDIUtilTest extends ActiveMQServerTestCase {
// OK // OK
} }
JNDIUtil.rebind(ic, "doesnotexistyet", Integer.valueOf(9)); JNDIUtil.rebind(ic, "doesnotexistyet", 9);
ProxyAssertSupport.assertEquals(9, ((Integer) ic.lookup("/doesnotexistyet")).intValue()); ProxyAssertSupport.assertEquals(9, ((Integer) ic.lookup("/doesnotexistyet")).intValue());

View File

@ -226,7 +226,7 @@ public class MessageTypeTest extends PTPTestCase {
try { try {
Vector<Object> vector = new Vector<>(); Vector<Object> vector = new Vector<>();
vector.add("pi"); vector.add("pi");
vector.add(Double.valueOf(3.14159)); vector.add(3.14159);
ObjectMessage message = senderSession.createObjectMessage(); ObjectMessage message = senderSession.createObjectMessage();
message.setObject(vector); message.setObject(vector);

View File

@ -59,7 +59,7 @@ public class MessagePropertyTest extends PTPTestCase {
public void testSetObjectProperty_1() { public void testSetObjectProperty_1() {
try { try {
Message message = senderSession.createMessage(); Message message = senderSession.createMessage();
message.setObjectProperty("pi", Float.valueOf(3.14159f)); message.setObjectProperty("pi", 3.14159f);
Assert.assertEquals(3.14159f, message.getFloatProperty("pi"), 0); Assert.assertEquals(3.14159f, message.getFloatProperty("pi"), 0);
} catch (JMSException e) { } catch (JMSException e) {
fail(e); fail(e);

View File

@ -405,7 +405,7 @@ public class BindingsImplTest extends ActiveMQTestBase {
@Override @Override
public Long getID() { public Long getID() {
return Long.valueOf(0L); return 0L;
} }
/* (non-Javadoc) /* (non-Javadoc)

View File

@ -452,7 +452,7 @@ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase {
@Override @Override
public Long getID() { public Long getID() {
return Long.valueOf(0); return 0L;
} }
@Override @Override