Resolve itest runbundles for Gson and Commons Lang upgrades and fix JsonParser deprecations (#10345)
* Resolve itest runbundles for Gson and Commons Lang upgrades * Fix JsonParser deprecations too * Fix feature verification Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -67,7 +67,6 @@ public class XiaomiBridgeHandler extends ConfigStatusBridgeHandler implements Xi
|
||||
private static final String NO = "no";
|
||||
|
||||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_BRIDGE);
|
||||
private static final JsonParser PARSER = new JsonParser();
|
||||
private static final EncryptionHelper CRYPTER = new EncryptionHelper();
|
||||
private static Map<String, JsonObject> retentionInbox = new ConcurrentHashMap<>();
|
||||
|
||||
@@ -175,7 +174,7 @@ public class XiaomiBridgeHandler extends ConfigStatusBridgeHandler implements Xi
|
||||
}
|
||||
break;
|
||||
case "get_id_list_ack":
|
||||
JsonArray devices = PARSER.parse(message.get("data").getAsString()).getAsJsonArray();
|
||||
JsonArray devices = JsonParser.parseString(message.get("data").getAsString()).getAsJsonArray();
|
||||
for (JsonElement deviceId : devices) {
|
||||
String device = deviceId.getAsString();
|
||||
sendCommandToBridge("read", device);
|
||||
|
||||
@@ -81,8 +81,6 @@ public class XiaomiDeviceBaseHandler extends BaseThingHandler implements XiaomiI
|
||||
private static final long ONLINE_TIMEOUT_MILLIS = TimeUnit.HOURS.toMillis(2);
|
||||
private ScheduledFuture<?> onlineCheckTask;
|
||||
|
||||
private JsonParser parser = new JsonParser();
|
||||
|
||||
private XiaomiBridgeHandler bridgeHandler;
|
||||
|
||||
private String itemId;
|
||||
@@ -148,7 +146,7 @@ public class XiaomiDeviceBaseHandler extends BaseThingHandler implements XiaomiI
|
||||
}
|
||||
logger.debug("Item got update: {}", message);
|
||||
try {
|
||||
JsonObject data = parser.parse(message.get("data").getAsString()).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(message.get("data").getAsString()).getAsJsonObject();
|
||||
parseCommand(command, data);
|
||||
if (THING_TYPE_BASIC.equals(getThing().getThingTypeUID())) {
|
||||
parseDefault(message);
|
||||
|
||||
@@ -44,7 +44,6 @@ public abstract class XiaomiSocket {
|
||||
static final String MCAST_ADDR = "224.0.0.50";
|
||||
|
||||
private static final int BUFFER_LENGTH = 1024;
|
||||
private static final JsonParser PARSER = new JsonParser();
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(XiaomiSocket.class);
|
||||
|
||||
@@ -197,7 +196,7 @@ public abstract class XiaomiSocket {
|
||||
logger.debug("Received Datagram from {}:{} on port {}", address.getHostAddress(),
|
||||
datagramPacket.getPort(), localPort);
|
||||
String sentence = new String(datagramPacket.getData(), 0, datagramPacket.getLength());
|
||||
JsonObject message = PARSER.parse(sentence).getAsJsonObject();
|
||||
JsonObject message = JsonParser.parseString(sentence).getAsJsonObject();
|
||||
notifyListeners(message, address);
|
||||
logger.trace("Data received and notified {} listeners", listeners.size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user