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:
Wouter Born
2021-03-18 12:15:15 +01:00
committed by GitHub
parent 009208adee
commit 580f293766
86 changed files with 206 additions and 215 deletions

View File

@@ -39,7 +39,7 @@ public class CeilingDevice extends DeviceBase {
@Override
public void onNotify(String msg) {
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
try {
if (result.has("id")) {
String id = result.get("id").getAsString();

View File

@@ -41,7 +41,7 @@ public class CeilingDeviceWithAmbientDevice extends CeilingDevice
public void onNotify(String msg) {
logger.debug("Got state: {}", msg);
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
if (result.has("id")) {
String id = result.get("id").getAsString();

View File

@@ -40,7 +40,7 @@ public class CeilingDeviceWithNightDevice extends CeilingDevice implements Devic
public void onNotify(String msg) {
logger.debug("Got state: {}", msg);
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
if (result.has("id")) {
String id = result.get("id").getAsString();

View File

@@ -39,7 +39,7 @@ public class CtBulbDevice extends DeviceBase {
@Override
public void onNotify(String msg) {
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
try {
if (result.has("id")) {
String id = result.get("id").getAsString();

View File

@@ -39,7 +39,7 @@ public class DesklampDevice extends DeviceBase {
@Override
public void onNotify(String msg) {
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
try {
if (result.has("id")) {
String id = result.get("id").getAsString();

View File

@@ -76,13 +76,13 @@ public abstract class DeviceBase {
public void onNotify(String response) {
boolean needNotify = true;
JsonObject message = new JsonParser().parse(response).getAsJsonObject();
JsonObject message = JsonParser.parseString(response).getAsJsonObject();
try {
if (message.has("method")) {
String method = message.get("method").toString().replace("\"", "");
if (method.equals("props")) {// Property notify
String params = message.get("params").toString();
JsonObject propsObject = new JsonParser().parse(params).getAsJsonObject();
JsonObject propsObject = JsonParser.parseString(params).getAsJsonObject();
for (Entry<String, JsonElement> prop : propsObject.entrySet()) {
final YeelightDeviceProperty property = YeelightDeviceProperty.fromString(prop.getKey());
if (null == property) {

View File

@@ -37,7 +37,7 @@ public class MonoDevice extends DeviceBase {
@Override
public void onNotify(String msg) {
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
try {
if (result.has("id")) {
String id = result.get("id").getAsString();

View File

@@ -39,7 +39,7 @@ public class PitayaDevice extends DeviceBase {
@Override
public void onNotify(String msg) {
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
try {
if (result.has("id")) {
String id = result.get("id").getAsString();

View File

@@ -39,7 +39,7 @@ public class WonderDevice extends DeviceBase {
@Override
public void onNotify(String msg) {
JsonObject result = new JsonParser().parse(msg).getAsJsonObject();
JsonObject result = JsonParser.parseString(msg).getAsJsonObject();
try {
if (result.has("id")) {
String id = result.get("id").getAsString();