Skip to content

Commit bfe401f

Browse files
committed
Replaces usage of deprecated method calls with more modern alternatives
Signed-off-by: Otavio R. Piske <angusyoung@gmail.com>
1 parent e123a60 commit bfe401f

15 files changed

Lines changed: 28 additions & 28 deletions

File tree

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/BasicTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public void testConnOptDefaults() throws Exception {
319319

320320
log.info("Check MqttConnectOptions defaults");
321321
MqttConnectOptions connOpts = new MqttConnectOptions();
322-
Assert.assertEquals(new Integer(connOpts.getKeepAliveInterval()), new Integer(60));
322+
Assert.assertEquals(Integer.valueOf(connOpts.getKeepAliveInterval()), Integer.valueOf(60));
323323
Assert.assertNull(connOpts.getPassword());
324324
Assert.assertNull(connOpts.getUserName());
325325
Assert.assertNull(connOpts.getSocketFactory());

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/ModelTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public void subscribe() throws Exception {
470470
public void subscribe(String topic, int qos, boolean expectRetained) throws Exception {
471471
logToFile("subscribe [topic:" + topic + "][qos:" + qos + "][expectRetained:" + expectRetained
472472
+ "]");
473-
subscribedTopics.put(topic, new Integer(qos));
473+
subscribedTopics.put(topic, Integer.valueOf(qos));
474474
client.subscribe(topic, qos);
475475
if (expectRetained) {
476476
waitForMessage(topic, retainedPublishes.get(topic), true);

org.eclipse.paho.client.mqttv3/src/main/java-templates/org/eclipse/paho/client/mqttv3/internal/ClientComms.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ public Properties getDebug() {
667667
props.put("conState", Integer.valueOf(conState));
668668
props.put("serverURI", getClient().getServerURI());
669669
props.put("callback", callback);
670-
props.put("stoppingComms", new Boolean(stoppingComms));
670+
props.put("stoppingComms", Boolean.valueOf(stoppingComms));
671671
return props;
672672
}
673673

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/MqttAsyncClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ public IMqttToken connect(MqttConnectOptions options, Object userContext, IMqttA
617617
// @TRACE 103=cleanSession={0} connectionTimeout={1} TimekeepAlive={2}
618618
// userName={3} password={4} will={5} userContext={6} callback={7}
619619
log.fine(CLASS_NAME, methodName, "103",
620-
new Object[] { Boolean.valueOf(options.isCleanSession()), new Integer(options.getConnectionTimeout()),
620+
new Object[] { Boolean.valueOf(options.isCleanSession()), Integer.valueOf(options.getConnectionTimeout()),
621621
Integer.valueOf(options.getKeepAliveInterval()), options.getUserName(),
622622
((null == options.getPassword()) ? "[null]" : "[notnull]"),
623623
((null == options.getWillMessage()) ? "[null]" : "[notnull]"), userContext, callback });

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal/Token.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected MqttWireMessage waitForResponse(long timeout) throws MqttException {
137137
if (this.exception == null) {
138138
try {
139139
//@TRACE 408=key={0} wait max={1}
140-
log.fine(CLASS_NAME,methodName,"408",new Object[] {getKey(),new Long(timeout)});
140+
log.fine(CLASS_NAME,methodName,"408",new Object[] {getKey(), Long.valueOf(timeout)});
141141

142142
if (timeout <= 0) {
143143
responseLock.wait();

org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/MqttAsyncClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,8 @@ public IMqttToken connect(MqttConnectionOptions options, Object userContext, Mqt
747747
// @TRACE 103=cleanStart={0} connectionTimeout={1} TimekeepAlive={2}
748748
// userName={3} password={4} will={5} userContext={6} callback={7}
749749
log.fine(CLASS_NAME, methodName, "103",
750-
new Object[] { Boolean.valueOf(options.isCleanStart()), new Integer(options.getConnectionTimeout()),
751-
new Integer(options.getKeepAliveInterval()), options.getUserName(),
750+
new Object[] { Boolean.valueOf(options.isCleanStart()), Integer.valueOf(options.getConnectionTimeout()),
751+
Integer.valueOf(options.getKeepAliveInterval()), options.getUserName(),
752752
((null == options.getPassword()) ? "[null]" : "[notnull]"),
753753
((null == options.getWillMessage()) ? "[null]" : "[notnull]"), userContext, callback });
754754
comms.setNetworkModules(createNetworkModules(serverURI, options));
@@ -828,7 +828,7 @@ public IMqttToken disconnect(long quiesceTimeout, Object userContext, MqttAction
828828
MqttProperties disconnectProperties) throws MqttException {
829829
final String methodName = "disconnect";
830830
// @TRACE 104=> quiesceTimeout={0} userContext={1} callback={2}
831-
log.fine(CLASS_NAME, methodName, "104", new Object[] { new Long(quiesceTimeout), userContext, callback });
831+
log.fine(CLASS_NAME, methodName, "104", new Object[] { Long.valueOf(quiesceTimeout), userContext, callback });
832832

833833
MqttToken token = new MqttToken(getClientId());
834834
token.setActionCallback(callback);
@@ -1578,7 +1578,7 @@ private void startReconnectCycle() {
15781578
String methodName = "startReconnectCycle";
15791579
// @Trace 503=Start reconnect timer for client: {0}, delay: {1}
15801580
log.fine(CLASS_NAME, methodName, "503",
1581-
new Object[] { this.mqttSession.getClientId(), new Long(reconnectDelay) });
1581+
new Object[] { this.mqttSession.getClientId(), Long.valueOf(reconnectDelay) });
15821582
reconnectTimer = new Timer("MQTT Reconnect: " + this.mqttSession.getClientId());
15831583
reconnectTimer.schedule(new ReconnectTask(), reconnectDelay);
15841584
}

org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/TimerPingSender.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private class PingTask extends TimerTask {
101101
public void run() {
102102
Thread.currentThread().setName("MQTT Ping: " + clientid);
103103
//@Trace 660=Check schedule at {0}
104-
log.fine(CLASS_NAME, methodName, "660", new Object[]{ new Long(System.nanoTime()) });
104+
log.fine(CLASS_NAME, methodName, "660", new Object[]{ Long.valueOf(System.nanoTime()) });
105105
comms.checkForActivity();
106106
}
107107
}
@@ -113,7 +113,7 @@ public void run() {
113113
String originalThreadName = Thread.currentThread().getName();
114114
Thread.currentThread().setName("MQTT Ping: " + clientid);
115115
//@Trace 660=Check schedule at {0}
116-
log.fine(CLASS_NAME, methodName, "660", new Object[]{ new Long(System.nanoTime()) });
116+
log.fine(CLASS_NAME, methodName, "660", new Object[]{ Long.valueOf(System.nanoTime()) });
117117
comms.checkForActivity();
118118
Thread.currentThread().setName(originalThreadName);
119119
}

org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/internal/ClientComms.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public void connect(MqttConnectionOptions options, MqttToken token) throws MqttE
332332
conbg.start();
333333
} else {
334334
// @TRACE 207=connect failed: not disconnected {0}
335-
log.fine(CLASS_NAME, methodName, "207", new Object[] { new Byte(conState) });
335+
log.fine(CLASS_NAME, methodName, "207", new Object[] { Byte.valueOf(conState) });
336336
if (isClosed() || closePending) {
337337
throw new MqttException(MqttClientException.REASON_CODE_CLIENT_CLOSED);
338338
} else if (isConnecting()) {
@@ -361,7 +361,7 @@ public void connectComplete(MqttConnAck cack, MqttException mex) throws MqttExce
361361
}
362362

363363
// @TRACE 204=connect failed: rc={0}
364-
log.fine(CLASS_NAME, methodName, "204", new Object[] { new Integer(rc) });
364+
log.fine(CLASS_NAME, methodName, "204", new Object[] { Integer.valueOf(rc) });
365365
throw mex;
366366
}
367367

@@ -724,10 +724,10 @@ public MqttConnectionOptions getConOptions() {
724724

725725
public Properties getDebug() {
726726
Properties props = new Properties();
727-
props.put("conState", new Integer(conState));
727+
props.put("conState", Integer.valueOf(conState));
728728
props.put("serverURI", getClient().getServerURI());
729729
props.put("callback", callback);
730-
props.put("stoppingComms", new Boolean(stoppingComms));
730+
props.put("stoppingComms", Boolean.valueOf(stoppingComms));
731731
return props;
732732
}
733733

org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/internal/ClientState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ protected boolean checkQuiesceLock() {
968968
// @TRACE 626=quiescing={0} actualInFlight={1} pendingFlows={2}
969969
// inFlightPubRels={3} callbackQuiesce={4} tokens={5}
970970
log.fine(CLASS_NAME, methodName, "626",
971-
new Object[] { new Boolean(quiescing), Integer.valueOf(actualInFlight),
971+
new Object[] { Boolean.valueOf(quiescing), Integer.valueOf(actualInFlight),
972972
Integer.valueOf(pendingFlows.size()), Integer.valueOf(inFlightPubRels),
973973
Boolean.valueOf(callback.isQuiesced()), Integer.valueOf(tokC) });
974974
synchronized (quiesceLock) {

org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/client/internal/CommsCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ private void handleMessage(MqttPublish publishMessage) throws Exception {
477477
String destName = publishMessage.getTopicName();
478478

479479
// @TRACE 713=call messageArrived key={0} topic={1}
480-
log.fine(CLASS_NAME, methodName, "713", new Object[] { new Integer(publishMessage.getMessageId()), destName });
480+
log.fine(CLASS_NAME, methodName, "713", new Object[] { Integer.valueOf(publishMessage.getMessageId()), destName });
481481
deliverMessage(destName, publishMessage.getMessageId(), publishMessage.getMessage());
482482

483483
// If we are not in manual ACK mode:

0 commit comments

Comments
 (0)