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:
parent
009208adee
commit
580f293766
bundles
org.openhab.binding.bsblan/src/test/java/org/openhab/binding/bsblan/internal/api
org.openhab.binding.bticinosmarther/src/main/java/org/openhab/binding/bticinosmarther/internal/api
org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl
org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection
org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler
org.openhab.binding.hue/src
main/java/org/openhab/binding/hue/internal
test/java/org/openhab/binding/hue/internal/handler
org.openhab.binding.iammeter/src/main/java/org/openhab/binding/iammeter/internal
org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler
org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal
org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol
org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/kostalinverter/internal/secondgeneration
org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/action
org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/leap
org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler
org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal
org.openhab.binding.miio/src
main/java/org/openhab/binding/miio/internal
test/java/org/openhab/binding/miio/internal
org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/client
org.openhab.binding.netatmo
org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/api
org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util
org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection
org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/handler
org.openhab.binding.pushover/src/main/java/org/openhab/binding/pushover/internal/connection
org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/discovery
org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models
org.openhab.binding.sensibo/src
main/java/org/openhab/binding/sensibo/internal
test/java/org/openhab/binding/sensibo/internal
org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/util
org.openhab.binding.smhi/src/main/java/org/openhab/binding/smhi/internal
org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/handler
org.openhab.binding.somfymylink/src/main/java/org/openhab/binding/somfymylink/internal/handler
org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol
org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api
org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils
org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal
org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler
org.openhab.binding.tibber/src/main/java/org/openhab/binding/tibber/internal/handler
org.openhab.binding.touchwand/src/main/java/org/openhab/binding/touchwand/internal
org.openhab.binding.tradfri/src
main/java/org/openhab/binding/tradfri/internal
test/java/org/openhab/binding/tradfri/internal/discovery
org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model
org.openhab.binding.unifiedremote/src/main/java/org/openhab/binding/unifiedremote/internal
org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/handler
org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device
CeilingDevice.javaCeilingDeviceWithAmbientDevice.javaCeilingDeviceWithNightDevice.javaCtBulbDevice.javaDesklampDevice.javaDeviceBase.javaMonoDevice.javaPitayaDevice.javaWonderDevice.java
org.openhab.binding.yioremote/src/main/java/org/openhab/binding/yioremote/internal
org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest
org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal
org.openhab.voice.marytts
itests
org.openhab.binding.astro.tests
org.openhab.binding.avmfritz.tests
org.openhab.binding.feed.tests
org.openhab.binding.hue.tests
org.openhab.binding.max.tests
org.openhab.binding.modbus.tests
org.openhab.binding.nest.tests
org.openhab.binding.ntp.tests
org.openhab.binding.systeminfo.tests
org.openhab.binding.tradfri.tests
org.openhab.binding.wemo.tests
org.openhab.persistence.mapdb.tests
@ -61,8 +61,7 @@ public class BsbLanApiContentConverterTests {
|
||||
String serializedRequest = BsbLanApiContentConverter.toJson(request);
|
||||
|
||||
// verify serialized content
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject json = parser.parse(serializedRequest).getAsJsonObject();
|
||||
JsonObject json = JsonParser.parseString(serializedRequest).getAsJsonObject();
|
||||
|
||||
// Although specifying the parameter as int (which would be nicer) also seems to work,
|
||||
// we use a String here as this is the way it is noted in the documentation.
|
||||
|
@ -84,7 +84,6 @@ public class SmartherApiConnector {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(SmartherApiConnector.class);
|
||||
|
||||
private final JsonParser parser = new JsonParser();
|
||||
private final HttpClient httpClient;
|
||||
private final ScheduledExecutorService scheduler;
|
||||
|
||||
@ -305,7 +304,7 @@ public class SmartherApiConnector {
|
||||
private String processErrorState(ContentResponse response)
|
||||
throws SmartherTokenExpiredException, SmartherAuthorizationException, SmartherInvalidResponseException {
|
||||
try {
|
||||
final JsonElement element = parser.parse(response.getContentAsString());
|
||||
final JsonElement element = JsonParser.parseString(response.getContentAsString());
|
||||
|
||||
if (element.isJsonObject()) {
|
||||
final JsonObject object = element.getAsJsonObject();
|
||||
|
@ -63,7 +63,7 @@ public class JSONResponseHandler {
|
||||
public static JsonObject toJsonObject(String jsonResponse) {
|
||||
if (jsonResponse != null && !jsonResponse.trim().equals("")) {
|
||||
try {
|
||||
return (JsonObject) new JsonParser().parse(jsonResponse);
|
||||
return (JsonObject) JsonParser.parseString(jsonResponse);
|
||||
} catch (JsonParseException e) {
|
||||
LOGGER.error("An JsonParseException occurred by parsing jsonRequest: {}", jsonResponse, e);
|
||||
}
|
||||
|
@ -77,7 +77,6 @@ public class EnturNoConnection {
|
||||
private final EnturNoHandler handler;
|
||||
private final HttpClient httpClient;
|
||||
|
||||
private final JsonParser parser = new JsonParser();
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
public EnturNoConnection(EnturNoHandler handler, HttpClient httpClient) {
|
||||
@ -168,7 +167,7 @@ public class EnturNoConnection {
|
||||
}
|
||||
|
||||
private String getErrorMessage(String response) {
|
||||
JsonObject jsonResponse = parser.parse(response).getAsJsonObject();
|
||||
JsonObject jsonResponse = JsonParser.parseString(response).getAsJsonObject();
|
||||
if (jsonResponse.has(PROPERTY_MESSAGE)) {
|
||||
return jsonResponse.get(PROPERTY_MESSAGE).getAsString();
|
||||
}
|
||||
|
@ -130,7 +130,6 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
private String ipAddress;
|
||||
|
||||
// JSON variables
|
||||
private JsonParser parser = new JsonParser();
|
||||
private Gson gson = new Gson();
|
||||
|
||||
private ScheduledFuture<?> logJob;
|
||||
@ -203,7 +202,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("initialize() Request : {}", systemTarget.resolveTemplate("ip", ipAddress)
|
||||
@ -303,7 +302,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("subscribe() Request : {}",
|
||||
@ -365,7 +364,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("unsubscribe() Request : {}",
|
||||
@ -426,7 +425,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("pullLog() Request : {}",
|
||||
@ -488,7 +487,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("getSwitches() Request : {}", switchTarget.resolveTemplate("ip", ipAddress)
|
||||
@ -506,7 +505,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
getThing().getUID().toString());
|
||||
String result = jsonObject.get("result").toString();
|
||||
result = result.replace("switch", "id");
|
||||
JsonObject js = parser.parse(result).getAsJsonObject();
|
||||
JsonObject js = JsonParser.parseString(result).getAsJsonObject();
|
||||
RESTSwitch[] switchArray = gson.fromJson(js.getAsJsonArray("ides"), RESTSwitch[].class);
|
||||
if (switchArray != null) {
|
||||
return Arrays.asList(switchArray);
|
||||
@ -554,7 +553,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("triggerSwitch() Request : {}",
|
||||
@ -609,7 +608,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("enableSwitch() Request : {}",
|
||||
@ -664,7 +663,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("getPorts() Request : {}", portTarget.resolveTemplate("ip", ipAddress)
|
||||
@ -732,7 +731,7 @@ public class HeliosHandler221 extends BaseThingHandler {
|
||||
}
|
||||
|
||||
if (response != null) {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("configureRunnable Request : {}", systemTarget.resolveTemplate("ip", ipAddress)
|
||||
|
@ -844,7 +844,7 @@ public class HueBridge {
|
||||
return super.doNetwork(address, requestMethod, body);
|
||||
} else {
|
||||
String extractedAddress = Util.quickMatch("^http://[^/]+(.+)$", address);
|
||||
JsonElement commandBody = new JsonParser().parse(body);
|
||||
JsonElement commandBody = body == null ? null : JsonParser.parseString(body);
|
||||
scheduleCommand = new ScheduleCommand(extractedAddress, requestMethod, commandBody);
|
||||
|
||||
// Return a fake result that will cause an exception and the callback to end
|
||||
|
@ -425,9 +425,8 @@ public class HueLightHandlerTest {
|
||||
}
|
||||
|
||||
private void assertJson(String expected, String actual) {
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonElement jsonExpected = parser.parse(expected);
|
||||
JsonElement jsonActual = parser.parse(actual);
|
||||
JsonElement jsonExpected = JsonParser.parseString(expected);
|
||||
JsonElement jsonActual = JsonParser.parseString(actual);
|
||||
assertEquals(jsonExpected, jsonActual);
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class Iammeter3080THandler extends IammeterBaseHandler {
|
||||
@SuppressWarnings("null")
|
||||
@Override
|
||||
protected void resolveData(String response) {
|
||||
JsonElement iammeterDataElement = new JsonParser().parse(response);
|
||||
JsonElement iammeterDataElement = JsonParser.parseString(response);
|
||||
JsonObject iammeterData = iammeterDataElement.getAsJsonObject();
|
||||
String keyWord = "Datas";
|
||||
if (iammeterData.has("Datas") && iammeterData.has("SN")) {
|
||||
|
@ -37,7 +37,7 @@ public class IammeterHandler extends IammeterBaseHandler {
|
||||
|
||||
@Override
|
||||
protected void resolveData(String response) {
|
||||
JsonElement iammeterDataElement = new JsonParser().parse(response);
|
||||
JsonElement iammeterDataElement = JsonParser.parseString(response);
|
||||
JsonObject iammeterData = iammeterDataElement.getAsJsonObject();
|
||||
String keyWord = "Data";
|
||||
if (iammeterData.has("data") || (iammeterData.has("Data") && iammeterData.has("SN"))) {
|
||||
|
@ -82,7 +82,6 @@ public class KeContactHandler extends BaseThingHandler {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(KeContactHandler.class);
|
||||
|
||||
protected final JsonParser parser = new JsonParser();
|
||||
private final KeContactTransceiver transceiver;
|
||||
|
||||
private ScheduledFuture<?> pollingJob;
|
||||
@ -236,7 +235,7 @@ public class KeContactHandler extends BaseThingHandler {
|
||||
}
|
||||
|
||||
try {
|
||||
JsonObject readObject = parser.parse(response).getAsJsonObject();
|
||||
JsonObject readObject = JsonParser.parseString(response).getAsJsonObject();
|
||||
|
||||
for (Entry<String, JsonElement> entry : readObject.entrySet()) {
|
||||
switch (entry.getKey()) {
|
||||
|
3
bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Device.java
3
bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Device.java
@ -40,7 +40,6 @@ import com.google.gson.JsonParser;
|
||||
public class KM200Device {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(KM200Device.class);
|
||||
private final JsonParser jsonParser = new JsonParser();
|
||||
private final KM200Cryption comCryption;
|
||||
private final KM200Comm<KM200Device> deviceCommunicator;
|
||||
|
||||
@ -360,7 +359,7 @@ public class KM200Device {
|
||||
logger.debug("{}: SERVICE NOT AVAILABLE", service);
|
||||
return null;
|
||||
} else {
|
||||
nodeRoot = (JsonObject) jsonParser.parse(decodedData);
|
||||
nodeRoot = (JsonObject) JsonParser.parseString(decodedData);
|
||||
}
|
||||
} else {
|
||||
logger.debug("Get empty reply");
|
||||
|
@ -48,7 +48,6 @@ import com.google.gson.JsonParser;
|
||||
@NonNullByDefault
|
||||
public class KM200DataHandler {
|
||||
private final Logger logger = LoggerFactory.getLogger(KM200DataHandler.class);
|
||||
private final JsonParser jsonParser = new JsonParser();
|
||||
|
||||
private final KM200Device remoteDevice;
|
||||
|
||||
@ -539,7 +538,7 @@ public class KM200DataHandler {
|
||||
/* The JSONArray of switch items can be send directly */
|
||||
try {
|
||||
/* Check whether this input string is a valid JSONArray */
|
||||
JsonArray userArray = (JsonArray) jsonParser.parse(val);
|
||||
JsonArray userArray = (JsonArray) JsonParser.parseString(val);
|
||||
newObject = userArray.getAsJsonObject();
|
||||
} catch (JsonParseException e) {
|
||||
logger.warn("The input for the switchProgram is not a valid JSONArray : {}",
|
||||
|
@ -54,7 +54,6 @@ public class KodiClientSocket {
|
||||
|
||||
private boolean connected = false;
|
||||
|
||||
private final JsonParser parser = new JsonParser();
|
||||
private final Gson mapper = new Gson();
|
||||
private final URI uri;
|
||||
private final WebSocketClient client;
|
||||
@ -130,7 +129,7 @@ public class KodiClientSocket {
|
||||
@OnWebSocketMessage
|
||||
public void onMessage(String message) {
|
||||
logger.trace("Message received from server: {}", message);
|
||||
final JsonObject json = parser.parse(message).getAsJsonObject();
|
||||
final JsonObject json = JsonParser.parseString(message).getAsJsonObject();
|
||||
if (json.has("id")) {
|
||||
int messageId = json.get("id").getAsInt();
|
||||
if (messageId == nextMessageId - 1) {
|
||||
|
@ -54,12 +54,12 @@ public class SecondGenerationConfigurationHandler {
|
||||
String getAuthenticateResponse = httpClient.GET(urlLogin).getContentAsString();
|
||||
|
||||
try {
|
||||
JsonObject getAuthenticateResponseJsonObject = (JsonObject) new JsonParser()
|
||||
.parse(transformJsonResponse(getAuthenticateResponse));
|
||||
JsonObject getAuthenticateResponseJsonObject = (JsonObject) JsonParser
|
||||
.parseString(transformJsonResponse(getAuthenticateResponse));
|
||||
|
||||
sessionId = extractSessionId(getAuthenticateResponseJsonObject);
|
||||
|
||||
JsonObject authenticateJsonObject = new JsonParser().parse(getAuthenticateResponse.toString())
|
||||
JsonObject authenticateJsonObject = JsonParser.parseString(getAuthenticateResponse.toString())
|
||||
.getAsJsonObject();
|
||||
salt = authenticateJsonObject.get("salt").getAsString();
|
||||
|
||||
@ -84,8 +84,8 @@ public class SecondGenerationConfigurationHandler {
|
||||
String loginPostResponse = new String(loginPostJsonDataContentResponse.getContent(),
|
||||
StandardCharsets.UTF_8);
|
||||
|
||||
JsonObject loginPostJsonObject = (JsonObject) new JsonParser()
|
||||
.parse(transformJsonResponse(loginPostResponse));
|
||||
JsonObject loginPostJsonObject = (JsonObject) JsonParser
|
||||
.parseString(transformJsonResponse(loginPostResponse));
|
||||
|
||||
sessionId = extractSessionId(loginPostJsonObject);
|
||||
|
||||
|
@ -154,8 +154,7 @@ public class LGWebOSActions implements ThingActions {
|
||||
@ActionInput(name = "appId", label = "@text/actionLaunchApplicationInputAppIDLabel", description = "@text/actionLaunchApplicationInputAppIDDesc") String appId,
|
||||
@ActionInput(name = "params", label = "@text/actionLaunchApplicationInputParamsLabel", description = "@text/actionLaunchApplicationInputParamsDesc") String params) {
|
||||
try {
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject payload = (JsonObject) parser.parse(params);
|
||||
JsonObject payload = (JsonObject) JsonParser.parseString(params);
|
||||
|
||||
Optional<AppInfo> appInfo = getAppInfos().stream().filter(a -> a.getId().equals(appId)).findFirst();
|
||||
if (appInfo.isPresent()) {
|
||||
|
@ -76,7 +76,7 @@ public class LeapMessageParser {
|
||||
logger.trace("Received message: {}", msg);
|
||||
|
||||
try {
|
||||
JsonObject message = (JsonObject) new JsonParser().parse(msg);
|
||||
JsonObject message = (JsonObject) JsonParser.parseString(msg);
|
||||
|
||||
if (!message.has("CommuniqueType")) {
|
||||
logger.debug("No CommuniqueType found in message: {}", msg);
|
||||
|
@ -144,7 +144,7 @@ public abstract class MieleApplianceHandler<E extends Enum<E> & ApplianceChannel
|
||||
|
||||
@Override
|
||||
public void onApplianceStateChanged(String UID, DeviceClassObject dco) {
|
||||
String myUID = ((String) getThing().getProperties().get(PROTOCOL_PROPERTY_NAME))
|
||||
String myUID = (getThing().getProperties().get(PROTOCOL_PROPERTY_NAME))
|
||||
+ (String) getThing().getConfiguration().getProperties().get(APPLIANCE_ID);
|
||||
String modelID = StringUtils.right(dco.DeviceClass,
|
||||
dco.DeviceClass.length() - new String("com.miele.xgw3000.gateway.hdm.deviceclasses.Miele").length());
|
||||
@ -177,7 +177,7 @@ public abstract class MieleApplianceHandler<E extends Enum<E> & ApplianceChannel
|
||||
|
||||
@Override
|
||||
public void onAppliancePropertyChanged(String UID, DeviceProperty dp) {
|
||||
String myUID = ((String) getThing().getProperties().get(PROTOCOL_PROPERTY_NAME))
|
||||
String myUID = (getThing().getProperties().get(PROTOCOL_PROPERTY_NAME))
|
||||
+ (String) getThing().getConfiguration().getProperties().get(APPLIANCE_ID);
|
||||
|
||||
if (myUID.equals(UID)) {
|
||||
@ -186,8 +186,7 @@ public abstract class MieleApplianceHandler<E extends Enum<E> & ApplianceChannel
|
||||
if (dp.Metadata == null) {
|
||||
String metadata = metaDataCache.get(new StringBuilder().append(dp.Name).toString().trim());
|
||||
if (metadata != null) {
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject jsonMetaData = (JsonObject) parser.parse(metadata);
|
||||
JsonObject jsonMetaData = (JsonObject) JsonParser.parseString(metadata);
|
||||
dmd = gson.fromJson(jsonMetaData, DeviceMetaData.class);
|
||||
// only keep the enum, if any - that's all we care for events we receive via multicast
|
||||
// all other fields are nulled
|
||||
@ -199,8 +198,7 @@ public abstract class MieleApplianceHandler<E extends Enum<E> & ApplianceChannel
|
||||
}
|
||||
if (dp.Metadata != null) {
|
||||
String metadata = StringUtils.replace(dp.Metadata.toString(), "enum", "MieleEnum");
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject jsonMetaData = (JsonObject) parser.parse(metadata);
|
||||
JsonObject jsonMetaData = (JsonObject) JsonParser.parseString(metadata);
|
||||
dmd = gson.fromJson(jsonMetaData, DeviceMetaData.class);
|
||||
metaDataCache.put(new StringBuilder().append(dp.Name).toString().trim(), metadata);
|
||||
}
|
||||
|
@ -480,8 +480,7 @@ public class MieleBridgeHandler extends BaseBridgeHandler {
|
||||
|
||||
if (responseData != null) {
|
||||
logger.debug("The request '{}' yields '{}'", requestData, responseData);
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject resp = (JsonObject) parser.parse(new StringReader(responseData));
|
||||
JsonObject resp = (JsonObject) JsonParser.parseReader(new StringReader(responseData));
|
||||
|
||||
result = resp.get("result");
|
||||
JsonElement error = resp.get("error");
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -98,10 +98,9 @@ public final class Utils {
|
||||
public static JsonObject convertFileToJSON(URL fileName) throws JsonIOException, JsonSyntaxException,
|
||||
JsonParseException, IOException, URISyntaxException, NoSuchFileException {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
JsonParser parser = new JsonParser();
|
||||
try (InputStream inputStream = fileName.openStream();
|
||||
InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
|
||||
JsonElement jsonElement = parser.parse(reader);
|
||||
JsonElement jsonElement = JsonParser.parseReader(reader);
|
||||
jsonObject = jsonElement.getAsJsonObject();
|
||||
return jsonObject;
|
||||
}
|
||||
|
@ -74,7 +74,6 @@ public class MiCloudConnector {
|
||||
private static final TimeZone TZ = TimeZone.getDefault();
|
||||
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("OOOO");
|
||||
private static final Gson GSON = new GsonBuilder().serializeNulls().create();
|
||||
private static final JsonParser PARSER = new JsonParser();
|
||||
|
||||
private final String clientId;
|
||||
|
||||
@ -156,7 +155,7 @@ public class MiCloudConnector {
|
||||
logger.trace("response: {}", mapResponse);
|
||||
String errorMsg = "";
|
||||
try {
|
||||
JsonElement response = PARSER.parse(mapResponse);
|
||||
JsonElement response = JsonParser.parseString(mapResponse);
|
||||
if (response.isJsonObject()) {
|
||||
logger.debug("Received JSON message {}", response);
|
||||
if (response.getAsJsonObject().has("result")
|
||||
@ -210,7 +209,7 @@ public class MiCloudConnector {
|
||||
final String response = getDeviceString(country);
|
||||
List<CloudDeviceDTO> devicesList = new ArrayList<>();
|
||||
try {
|
||||
final JsonElement resp = PARSER.parse(response);
|
||||
final JsonElement resp = JsonParser.parseString(response);
|
||||
if (resp.isJsonObject()) {
|
||||
final JsonObject jor = resp.getAsJsonObject();
|
||||
if (jor.has("result")) {
|
||||
@ -413,7 +412,7 @@ public class MiCloudConnector {
|
||||
logger.trace("Xiaomi Login step 1 content response= {}", content);
|
||||
logger.trace("Xiaomi Login step 1 response = {}", responseStep1);
|
||||
try {
|
||||
JsonElement resp = new JsonParser().parse(parseJson(content));
|
||||
JsonElement resp = JsonParser.parseString(parseJson(content));
|
||||
if (resp.isJsonObject() && resp.getAsJsonObject().has("_sign")) {
|
||||
String sign = resp.getAsJsonObject().get("_sign").getAsString();
|
||||
logger.trace("Xiaomi Login step 1 sign = {}", sign);
|
||||
@ -457,7 +456,7 @@ public class MiCloudConnector {
|
||||
logger.trace("Xiaomi login step 2 response = {}", responseStep2);
|
||||
logger.trace("Xiaomi login step 2 content = {}", content2);
|
||||
|
||||
JsonElement resp2 = new JsonParser().parse(parseJson(content2));
|
||||
JsonElement resp2 = JsonParser.parseString(parseJson(content2));
|
||||
CloudLoginDTO jsonResp = GSON.fromJson(resp2, CloudLoginDTO.class);
|
||||
if (jsonResp == null) {
|
||||
throw new MiCloudException("Error getting logon details from step 2: " + content2);
|
||||
|
@ -58,7 +58,6 @@ import org.slf4j.LoggerFactory;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
/**
|
||||
* The {@link MiIoAbstractHandler} is responsible for handling commands, which are
|
||||
@ -76,7 +75,6 @@ public abstract class MiIoAbstractHandler extends BaseThingHandler implements Mi
|
||||
protected MiIoDevices miDevice = MiIoDevices.UNKNOWN;
|
||||
protected boolean isIdentified;
|
||||
|
||||
protected final JsonParser parser = new JsonParser();
|
||||
protected byte[] token = new byte[0];
|
||||
|
||||
protected @Nullable MiIoBindingConfiguration configuration;
|
||||
|
@ -73,6 +73,7 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonIOException;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
|
||||
@ -505,7 +506,8 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
|
||||
|
||||
private void updatePropsFromJsonArray(MiIoSendCommand response) {
|
||||
JsonArray res = response.getResult().getAsJsonArray();
|
||||
JsonArray para = parser.parse(response.getCommandString()).getAsJsonObject().get("params").getAsJsonArray();
|
||||
JsonArray para = JsonParser.parseString(response.getCommandString()).getAsJsonObject().get("params")
|
||||
.getAsJsonArray();
|
||||
if (res.size() != para.size()) {
|
||||
logger.debug("Unexpected size different. Request size {}, response size {}. (Req: {}, Resp:{})",
|
||||
para.size(), res.size(), para, res);
|
||||
|
@ -73,7 +73,6 @@ public class MiIoAsyncCommunication {
|
||||
private AtomicInteger id = new AtomicInteger(-1);
|
||||
private int timeDelta;
|
||||
private int timeStamp;
|
||||
private final JsonParser parser;
|
||||
private @Nullable MessageSenderThread senderThread;
|
||||
private boolean connected;
|
||||
private ThingStatusDetail status = ThingStatusDetail.NONE;
|
||||
@ -94,7 +93,6 @@ public class MiIoAsyncCommunication {
|
||||
this.timeout = timeout;
|
||||
this.cloudConnector = cloudConnector;
|
||||
setId(id);
|
||||
parser = new JsonParser();
|
||||
startReceiver();
|
||||
}
|
||||
|
||||
@ -150,7 +148,7 @@ public class MiIoAsyncCommunication {
|
||||
}
|
||||
fullCommand.addProperty("id", cmdId);
|
||||
fullCommand.addProperty("method", command);
|
||||
fullCommand.add("params", parser.parse(params));
|
||||
fullCommand.add("params", JsonParser.parseString(params));
|
||||
MiIoSendCommand sendCmd = new MiIoSendCommand(cmdId, MiIoCommand.getCommand(command), fullCommand,
|
||||
cloudServer);
|
||||
concurrentLinkedQueue.add(sendCmd);
|
||||
@ -188,7 +186,7 @@ public class MiIoAsyncCommunication {
|
||||
// hack due to avoid invalid json errors from some misbehaving device firmwares
|
||||
decryptedResponse = decryptedResponse.replace(",,", ",");
|
||||
JsonElement response;
|
||||
response = parser.parse(decryptedResponse);
|
||||
response = JsonParser.parseString(decryptedResponse);
|
||||
if (!response.isJsonObject()) {
|
||||
errorMsg = "Received message is not a JSON object ";
|
||||
} else {
|
||||
|
3
bundles/org.openhab.binding.miio/src/test/java/org/openhab/binding/miio/internal/ReadmeHelper.java
3
bundles/org.openhab.binding.miio/src/test/java/org/openhab/binding/miio/internal/ReadmeHelper.java
@ -292,8 +292,7 @@ public class ReadmeHelper {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
|
||||
try {
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonElement jsonElement = parser.parse(new FileReader(fileName));
|
||||
JsonElement jsonElement = JsonParser.parseReader(new FileReader(fileName));
|
||||
jsonObject = jsonElement.getAsJsonObject();
|
||||
} catch (FileNotFoundException e) {
|
||||
//
|
||||
|
@ -41,12 +41,10 @@ import com.google.gson.JsonSyntaxException;
|
||||
public final class RequestLogger {
|
||||
private final Logger logger = LoggerFactory.getLogger(RequestLogger.class);
|
||||
private final AtomicLong nextId = new AtomicLong();
|
||||
private final JsonParser parser;
|
||||
private final Gson gson;
|
||||
private final String prefix;
|
||||
|
||||
public RequestLogger(final String prefix, final Gson gson) {
|
||||
this.parser = new JsonParser();
|
||||
this.gson = gson;
|
||||
this.prefix = prefix;
|
||||
}
|
||||
@ -124,7 +122,7 @@ public final class RequestLogger {
|
||||
|
||||
private String reformatJson(final String jsonString) {
|
||||
try {
|
||||
final JsonElement json = parser.parse(jsonString);
|
||||
final JsonElement json = JsonParser.parseString(jsonString);
|
||||
return gson.toJson(json);
|
||||
} catch (final JsonSyntaxException e) {
|
||||
logger.debug("Could not reformat malformed JSON due to '{}'", e.getMessage());
|
||||
|
@ -79,6 +79,12 @@
|
||||
<version>1.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -43,7 +43,7 @@ public class ControllerVariables {
|
||||
public static ControllerVariables parse(String response) {
|
||||
LOGGER.debug("Parsing string: \"{}\"", response);
|
||||
/* parse json string */
|
||||
JsonObject jsonObject = new JsonParser().parse(response).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response).getAsJsonObject();
|
||||
ControllerVariables info = new ControllerVariables();
|
||||
info.dist = jsonObject.get("dist").getAsInt();
|
||||
info.door = jsonObject.get("door").getAsInt();
|
||||
|
@ -27,8 +27,6 @@ import com.google.gson.JsonParser;
|
||||
* @author Chris Graham - Initial contribution
|
||||
*/
|
||||
public class Parse {
|
||||
private static JsonParser jsonParser = new JsonParser();
|
||||
|
||||
/**
|
||||
* Parses an integer from a JSON string given its key name.
|
||||
*
|
||||
@ -37,7 +35,7 @@ public class Parse {
|
||||
* @return int value of the objects data.
|
||||
*/
|
||||
public static int jsonInt(String jsonData, String keyName) {
|
||||
JsonElement jelement = jsonParser.parse(jsonData);
|
||||
JsonElement jelement = JsonParser.parseString(jsonData);
|
||||
JsonObject jobject = jelement.getAsJsonObject();
|
||||
return jobject.get(keyName).getAsInt();
|
||||
}
|
||||
@ -50,7 +48,7 @@ public class Parse {
|
||||
* @return String value of the objects data.
|
||||
*/
|
||||
public static String jsonString(String jsonData, String keyName) {
|
||||
JsonElement jelement = jsonParser.parse(jsonData);
|
||||
JsonElement jelement = JsonParser.parseString(jsonData);
|
||||
JsonObject jobject = jelement.getAsJsonObject();
|
||||
return jobject.get(keyName).getAsString();
|
||||
}
|
||||
@ -64,7 +62,7 @@ public class Parse {
|
||||
* @return int value of the objects data.
|
||||
*/
|
||||
public static int jsonIntAtArrayIndex(String jsonData, String keyName, int index) {
|
||||
JsonElement jelement = jsonParser.parse(jsonData);
|
||||
JsonElement jelement = JsonParser.parseString(jsonData);
|
||||
JsonObject jobject = jelement.getAsJsonObject();
|
||||
JsonArray jarray = jobject.get(keyName).getAsJsonArray();
|
||||
return jarray.get(index).getAsInt();
|
||||
@ -79,7 +77,7 @@ public class Parse {
|
||||
* @return String value of the objects data.
|
||||
*/
|
||||
public static String jsonStringAtArrayIndex(String jsonData, String keyName, int index) {
|
||||
JsonElement jelement = jsonParser.parse(jsonData);
|
||||
JsonElement jelement = JsonParser.parseString(jsonData);
|
||||
JsonObject jobject = jelement.getAsJsonObject();
|
||||
JsonArray jarray = jobject.get(keyName).getAsJsonArray();
|
||||
return jarray.get(index).getAsString();
|
||||
@ -95,7 +93,7 @@ public class Parse {
|
||||
public static List<Integer> jsonIntArray(String jsonData, String keyName) {
|
||||
List<Integer> returnList = new ArrayList<>();
|
||||
|
||||
JsonElement jelement = jsonParser.parse(jsonData);
|
||||
JsonElement jelement = JsonParser.parseString(jsonData);
|
||||
JsonObject jobject = jelement.getAsJsonObject();
|
||||
JsonArray jarray = jobject.get(keyName).getAsJsonArray();
|
||||
|
||||
@ -116,7 +114,7 @@ public class Parse {
|
||||
public static List<String> jsonStringArray(String jsonData, String keyName) {
|
||||
List<String> returnList = new ArrayList<>();
|
||||
|
||||
JsonElement jelement = jsonParser.parse(jsonData);
|
||||
JsonElement jelement = JsonParser.parseString(jsonData);
|
||||
JsonObject jobject = jelement.getAsJsonObject();
|
||||
JsonArray jarray = jobject.get(keyName).getAsJsonArray();
|
||||
|
||||
|
@ -100,7 +100,6 @@ public class OpenWeatherMapConnection {
|
||||
private static final ByteArrayFileCache IMAGE_CACHE = new ByteArrayFileCache("org.openhab.binding.openweathermap");
|
||||
private final ExpiringCacheMap<String, String> cache;
|
||||
|
||||
private final JsonParser parser = new JsonParser();
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
public OpenWeatherMapConnection(OpenWeatherMapAPIHandler handler, HttpClient httpClient) {
|
||||
@ -408,7 +407,7 @@ public class OpenWeatherMapConnection {
|
||||
}
|
||||
|
||||
private String getErrorMessage(String response) {
|
||||
JsonElement jsonResponse = parser.parse(response);
|
||||
JsonElement jsonResponse = JsonParser.parseString(response);
|
||||
if (jsonResponse.isJsonObject()) {
|
||||
JsonObject json = jsonResponse.getAsJsonObject();
|
||||
if (json.has(PROPERTY_MESSAGE)) {
|
||||
|
@ -47,7 +47,6 @@ public class AccountHandler extends BaseBridgeHandler {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
private static final int TOKEN_MIN_DIFF_MS = (int) TimeUnit.DAYS.toMillis(2);
|
||||
private final JsonParser jsonParser = new JsonParser();
|
||||
|
||||
private @NonNullByDefault({}) String authToken;
|
||||
private int refreshInterval;
|
||||
@ -114,7 +113,7 @@ public class AccountHandler extends BaseBridgeHandler {
|
||||
|
||||
InputStream content = new ByteArrayInputStream(httpBody.toString().getBytes(StandardCharsets.UTF_8));
|
||||
String urlResponse = HttpUtil.executeUrl("POST", url, urlHeader, content, "application/json", 2000);
|
||||
JsonObject responseJson = (JsonObject) jsonParser.parse(urlResponse);
|
||||
JsonObject responseJson = (JsonObject) JsonParser.parseString(urlResponse);
|
||||
|
||||
if (responseJson.has(AUTH_TOKEN)) {
|
||||
// Store the expire date for automatic token refresh
|
||||
|
@ -70,7 +70,6 @@ public class MeterHandler extends BaseThingHandler {
|
||||
private final GsonBuilder gsonBuilder = new GsonBuilder().registerTypeAdapter(ReadingInstance.class,
|
||||
new CustomReadingInstanceDeserializer());
|
||||
private final Gson gson = gsonBuilder.create();
|
||||
private final JsonParser jsonParser = new JsonParser();
|
||||
|
||||
private @NonNullByDefault({}) String resourceID;
|
||||
private @NonNullByDefault({}) String meterID;
|
||||
@ -178,7 +177,7 @@ public class MeterHandler extends BaseThingHandler {
|
||||
urlHeader.put("Authorization", token);
|
||||
|
||||
String urlResponse = HttpUtil.executeUrl("GET", url, urlHeader, null, null, 2000);
|
||||
JsonObject responseJson = (JsonObject) jsonParser.parse(urlResponse);
|
||||
JsonObject responseJson = (JsonObject) JsonParser.parseString(urlResponse);
|
||||
|
||||
if (responseJson.has("meter_id")) {
|
||||
setMeterID(responseJson.get("meter_id").toString());
|
||||
@ -251,7 +250,7 @@ public class MeterHandler extends BaseThingHandler {
|
||||
|
||||
String urlResponse = HttpUtil.executeUrl("GET", url, urlHeader, null, null, 2000);
|
||||
|
||||
ReadingInstance latestReading = gson.fromJson(new JsonParser().parse(urlResponse), ReadingInstance.class);
|
||||
ReadingInstance latestReading = gson.fromJson(JsonParser.parseString(urlResponse), ReadingInstance.class);
|
||||
|
||||
return new MeterState(Objects.requireNonNull(latestReading));
|
||||
} catch (IOException e) {
|
||||
|
@ -61,8 +61,6 @@ public class PushoverAPIConnection {
|
||||
|
||||
private final ExpiringCacheMap<String, String> cache = new ExpiringCacheMap<>(TimeUnit.DAYS.toMillis(1));
|
||||
|
||||
private final JsonParser parser = new JsonParser();
|
||||
|
||||
public PushoverAPIConnection(HttpClient httpClient, PushoverAccountConfiguration config) {
|
||||
this.httpClient = httpClient;
|
||||
this.config = config;
|
||||
@ -80,7 +78,7 @@ public class PushoverAPIConnection {
|
||||
|
||||
public String sendPriorityMessage(PushoverMessageBuilder message)
|
||||
throws PushoverCommunicationException, PushoverConfigurationException {
|
||||
final JsonObject json = parser.parse(post(MESSAGE_URL, message.build())).getAsJsonObject();
|
||||
final JsonObject json = JsonParser.parseString(post(MESSAGE_URL, message.build())).getAsJsonObject();
|
||||
return getMessageStatus(json) && json.has("receipt") ? json.get("receipt").getAsString() : "";
|
||||
}
|
||||
|
||||
@ -100,16 +98,14 @@ public class PushoverAPIConnection {
|
||||
params.put(PushoverMessageBuilder.MESSAGE_KEY_TOKEN, localApikey);
|
||||
|
||||
// TODO do not cache the response, cache the parsed list of sounds
|
||||
final JsonObject json = parser.parse(getFromCache(buildURL(SOUNDS_URL, params))).getAsJsonObject();
|
||||
if (json.has("sounds")) {
|
||||
final JsonObject sounds = json.get("sounds").getAsJsonObject();
|
||||
if (sounds != null) {
|
||||
return Collections.unmodifiableList(sounds.entrySet().stream()
|
||||
final String content = getFromCache(buildURL(SOUNDS_URL, params));
|
||||
final JsonObject json = content == null ? null : JsonParser.parseString(content).getAsJsonObject();
|
||||
final JsonObject sounds = json == null || !json.has("sounds") ? null : json.get("sounds").getAsJsonObject();
|
||||
|
||||
return sounds == null ? List.of()
|
||||
: Collections.unmodifiableList(sounds.entrySet().stream()
|
||||
.map(entry -> new Sound(entry.getKey(), entry.getValue().getAsString()))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private String buildURL(String url, Map<String, String> requestParams) {
|
||||
@ -172,7 +168,7 @@ public class PushoverAPIConnection {
|
||||
}
|
||||
|
||||
private String getMessageError(String content) {
|
||||
final JsonObject json = parser.parse(content).getAsJsonObject();
|
||||
final JsonObject json = JsonParser.parseString(content).getAsJsonObject();
|
||||
if (json.has("errors")) {
|
||||
final JsonArray errors = json.get("errors").getAsJsonArray();
|
||||
if (errors != null) {
|
||||
@ -183,7 +179,7 @@ public class PushoverAPIConnection {
|
||||
}
|
||||
|
||||
private boolean getMessageStatus(String content) {
|
||||
final JsonObject json = parser.parse(content).getAsJsonObject();
|
||||
final JsonObject json = JsonParser.parseString(content).getAsJsonObject();
|
||||
return json.has("status") ? json.get("status").getAsInt() == 1 : false;
|
||||
}
|
||||
|
||||
|
@ -50,12 +50,12 @@ import com.google.gson.JsonSyntaxException;
|
||||
/**
|
||||
* The {@link RadioThermostatDiscoveryService} is responsible for discovery of
|
||||
* RadioThermostats on the local network
|
||||
*
|
||||
*
|
||||
* @author William Welliver - Initial contribution
|
||||
* @author Dan Cunningham - Refactoring and Improvements
|
||||
* @author Bill Forsyth - Modified for the RadioThermostat's peculiar discovery mode
|
||||
* @author Michael Lobstein - Cleanup for RadioThermostat
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@NonNullByDefault
|
||||
@ -245,7 +245,7 @@ public class RadioThermostatDiscoveryService extends AbstractDiscoveryService {
|
||||
try {
|
||||
// Run the HTTP request and get the JSON response from the thermostat
|
||||
sysinfo = HttpUtil.executeUrl("GET", url, 20000);
|
||||
content = new JsonParser().parse(sysinfo).getAsJsonObject();
|
||||
content = JsonParser.parseString(sysinfo).getAsJsonObject();
|
||||
uuid = content.get("uuid").getAsString();
|
||||
} catch (IOException | JsonSyntaxException e) {
|
||||
logger.debug("Cannot get system info from thermostat {} {}", ip, e.getMessage());
|
||||
@ -254,7 +254,7 @@ public class RadioThermostatDiscoveryService extends AbstractDiscoveryService {
|
||||
|
||||
try {
|
||||
String nameinfo = HttpUtil.executeUrl("GET", url + "name", 20000);
|
||||
content = new JsonParser().parse(nameinfo).getAsJsonObject();
|
||||
content = JsonParser.parseString(nameinfo).getAsJsonObject();
|
||||
name = content.get("name").getAsString();
|
||||
} catch (IOException | JsonSyntaxException e) {
|
||||
logger.debug("Cannot get name from thermostat {} {}", ip, e.getMessage());
|
||||
|
@ -38,8 +38,7 @@ public class AtomicStringTypeAdapter extends TypeAdapter<AtomicReference<String>
|
||||
public AtomicReference<String> read(JsonReader in) throws IOException {
|
||||
AtomicReference<String> value = null;
|
||||
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
JsonElement je = jsonParser.parse(in);
|
||||
JsonElement je = JsonParser.parseReader(in);
|
||||
|
||||
if (je instanceof JsonPrimitive) {
|
||||
value = new AtomicReference<>();
|
||||
|
@ -41,12 +41,10 @@ import com.google.gson.JsonSyntaxException;
|
||||
public final class RequestLogger {
|
||||
private final Logger logger = LoggerFactory.getLogger(RequestLogger.class);
|
||||
private final AtomicLong nextId = new AtomicLong();
|
||||
private final JsonParser parser;
|
||||
private final Gson gson;
|
||||
private final String prefix;
|
||||
|
||||
public RequestLogger(final String prefix, final Gson gson) {
|
||||
parser = new JsonParser();
|
||||
this.gson = gson;
|
||||
this.prefix = prefix;
|
||||
}
|
||||
@ -133,7 +131,7 @@ public final class RequestLogger {
|
||||
|
||||
private String reformatJson(final String jsonString) {
|
||||
try {
|
||||
final JsonElement json = parser.parse(jsonString);
|
||||
final JsonElement json = JsonParser.parseString(jsonString);
|
||||
return gson.toJson(json);
|
||||
} catch (final JsonSyntaxException e) {
|
||||
logger.debug("Could not reformat malformed JSON due to '{}'", e.getMessage());
|
||||
|
@ -85,7 +85,6 @@ public class SensiboAccountHandler extends BaseBridgeHandler {
|
||||
public static String API_ENDPOINT = "https://home.sensibo.com/api";
|
||||
private final Logger logger = LoggerFactory.getLogger(SensiboAccountHandler.class);
|
||||
private final HttpClient httpClient;
|
||||
private final JsonParser jsonParser = new JsonParser();
|
||||
private final RequestLogger requestLogger;
|
||||
private final Gson gson;
|
||||
private SensiboModel model = new SensiboModel(0);
|
||||
@ -207,7 +206,7 @@ public class SensiboAccountHandler extends BaseBridgeHandler {
|
||||
final ContentResponse contentResponse = request.send();
|
||||
final String responseJson = contentResponse.getContentAsString();
|
||||
if (contentResponse.getStatus() == HttpStatus.OK_200) {
|
||||
final JsonObject o = jsonParser.parse(responseJson).getAsJsonObject();
|
||||
final JsonObject o = JsonParser.parseString(responseJson).getAsJsonObject();
|
||||
final String overallStatus = o.get("status").getAsString();
|
||||
if ("success".equals(overallStatus)) {
|
||||
return gson.fromJson(o.get("result"), responseType);
|
||||
|
@ -12,7 +12,7 @@
|
||||
*/
|
||||
package org.openhab.binding.sensibo.internal;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
@ -54,8 +54,7 @@ public class WireHelper {
|
||||
final String json = new String(WireHelper.class.getResourceAsStream(jsonClasspathName).readAllBytes(),
|
||||
StandardCharsets.UTF_8);
|
||||
|
||||
final JsonParser parser = new JsonParser();
|
||||
final JsonObject o = parser.parse(json).getAsJsonObject();
|
||||
final JsonObject o = JsonParser.parseString(json).getAsJsonObject();
|
||||
assertEquals("success", o.get("status").getAsString());
|
||||
|
||||
return gson.fromJson(o.get("result"), type);
|
||||
|
@ -44,7 +44,6 @@ import org.openhab.core.types.UnDefType;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.internal.Primitives;
|
||||
|
||||
/**
|
||||
* {@link ShellyUtils} provides general utility functions
|
||||
@ -78,7 +77,7 @@ public class ShellyUtils {
|
||||
}
|
||||
|
||||
if (classOfT.isInstance(json)) {
|
||||
return Primitives.wrap(classOfT).cast(json);
|
||||
return wrap(classOfT).cast(json);
|
||||
} else if (json.isEmpty()) { // update GSON might return null
|
||||
throw new ShellyApiException(PRE + className + "from empty JSON");
|
||||
} else {
|
||||
@ -97,6 +96,37 @@ public class ShellyUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> Class<T> wrap(Class<T> type) {
|
||||
if (type == int.class) {
|
||||
return (Class<T>) Integer.class;
|
||||
}
|
||||
if (type == float.class) {
|
||||
return (Class<T>) Float.class;
|
||||
}
|
||||
if (type == byte.class) {
|
||||
return (Class<T>) Byte.class;
|
||||
}
|
||||
if (type == double.class) {
|
||||
return (Class<T>) Double.class;
|
||||
}
|
||||
if (type == long.class) {
|
||||
return (Class<T>) Long.class;
|
||||
}
|
||||
if (type == char.class) {
|
||||
return (Class<T>) Character.class;
|
||||
}
|
||||
if (type == boolean.class) {
|
||||
return (Class<T>) Boolean.class;
|
||||
}
|
||||
if (type == short.class) {
|
||||
return (Class<T>) Short.class;
|
||||
}
|
||||
if (type == void.class) {
|
||||
return (Class<T>) Void.class;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public static String mkChannelId(String group, String channel) {
|
||||
return group + "#" + channel;
|
||||
}
|
||||
|
@ -36,8 +36,6 @@ import com.google.gson.JsonParser;
|
||||
@NonNullByDefault
|
||||
public class Parser {
|
||||
|
||||
private static JsonParser parser = new JsonParser();
|
||||
|
||||
/**
|
||||
* Parse a json string received from Smhi containing forecasts.
|
||||
*
|
||||
@ -46,7 +44,7 @@ public class Parser {
|
||||
*/
|
||||
public static TimeSeries parseTimeSeries(String json) {
|
||||
ZonedDateTime referenceTime;
|
||||
JsonObject object = parser.parse(json).getAsJsonObject();
|
||||
JsonObject object = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
referenceTime = parseApprovedTime(json);
|
||||
JsonArray timeSeries = object.get("timeSeries").getAsJsonArray();
|
||||
@ -65,7 +63,7 @@ public class Parser {
|
||||
* @return {@link ZonedDateTime} of the reference time
|
||||
*/
|
||||
public static ZonedDateTime parseApprovedTime(String json) {
|
||||
JsonObject timeObj = parser.parse(json).getAsJsonObject();
|
||||
JsonObject timeObj = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
return ZonedDateTime.parse(timeObj.get("referenceTime").getAsString());
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public class SolarLogHandler extends BaseThingHandler {
|
||||
|
||||
logger.debug("Attempting to load data from {} with parameter {}", url, content);
|
||||
String response = HttpUtil.executeUrl(httpMethod, url, stream, null, timeout);
|
||||
JsonElement solarLogDataElement = new JsonParser().parse(response);
|
||||
JsonElement solarLogDataElement = JsonParser.parseString(response);
|
||||
JsonObject solarLogData = solarLogDataElement.getAsJsonObject();
|
||||
|
||||
// Check whether the data is well-formed
|
||||
|
@ -337,8 +337,7 @@ public class SomfyMyLinkBridgeHandler extends BaseBridgeHandler {
|
||||
}
|
||||
|
||||
private <T extends SomfyMyLinkResponseBase> T parseResponse(Reader reader, Class<T> responseType) {
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject jsonObj = parser.parse(gson.newJsonReader(reader)).getAsJsonObject();
|
||||
JsonObject jsonObj = JsonParser.parseReader(gson.newJsonReader(reader)).getAsJsonObject();
|
||||
|
||||
logger.debug("Got full message: {}", jsonObj.toString());
|
||||
|
||||
|
@ -60,7 +60,6 @@ public class SonyAudioClientSocket {
|
||||
private final URI uri;
|
||||
private Session session;
|
||||
|
||||
private final JsonParser parser = new JsonParser();
|
||||
private final Gson mapper;
|
||||
|
||||
private static int ping = 0;
|
||||
@ -149,7 +148,7 @@ public class SonyAudioClientSocket {
|
||||
public void onMessage(String message) {
|
||||
logger.debug("Message received from server: {}", message);
|
||||
try {
|
||||
final JsonObject json = parser.parse(message).getAsJsonObject();
|
||||
final JsonObject json = JsonParser.parseString(message).getAsJsonObject();
|
||||
if (json.has("id")) {
|
||||
logger.debug("Response received from server: {}", json);
|
||||
int messageId = json.get("id").getAsInt();
|
||||
|
@ -53,7 +53,6 @@ class SpotifyConnector {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(SpotifyConnector.class);
|
||||
|
||||
private final JsonParser parser = new JsonParser();
|
||||
private final HttpClient httpClient;
|
||||
private final ScheduledExecutorService scheduler;
|
||||
|
||||
@ -234,7 +233,7 @@ class SpotifyConnector {
|
||||
*/
|
||||
private String processErrorState(ContentResponse response) {
|
||||
try {
|
||||
final JsonElement element = parser.parse(response.getContentAsString());
|
||||
final JsonElement element = JsonParser.parseString(response.getContentAsString());
|
||||
|
||||
if (element.isJsonObject()) {
|
||||
final JsonObject object = element.getAsJsonObject();
|
||||
|
@ -104,7 +104,7 @@ public class HttpUtils {
|
||||
String url = "http://" + ip + ":" + webPort + "/jsonrpc.js";
|
||||
String json = HttpUtils.post(url, JSON_REQ);
|
||||
logger.trace("Recieved json from server {}", json);
|
||||
JsonElement resp = new JsonParser().parse(json);
|
||||
JsonElement resp = JsonParser.parseString(json);
|
||||
String cliPort = resp.getAsJsonObject().get("result").getAsJsonObject().get("_p2").getAsString();
|
||||
return Integer.parseInt(cliPort);
|
||||
}
|
||||
|
@ -385,8 +385,7 @@ public class SurePetcareAPIHelper {
|
||||
*/
|
||||
private JsonElement getDataFromApi(String url) throws SurePetcareApiException {
|
||||
String apiResult = getResultFromApi(url);
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject object = (JsonObject) parser.parse(apiResult);
|
||||
JsonObject object = (JsonObject) JsonParser.parseString(apiResult);
|
||||
return object.get("data");
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,6 @@ public class TeslaAccountHandler extends BaseBridgeHandler {
|
||||
protected ReentrantLock lock;
|
||||
|
||||
private final Gson gson = new Gson();
|
||||
private final JsonParser parser = new JsonParser();
|
||||
|
||||
private TokenResponse logonToken;
|
||||
private final Set<VehicleListener> vehicleListeners = new HashSet<>();
|
||||
@ -215,7 +214,7 @@ public class TeslaAccountHandler extends BaseBridgeHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
Vehicle[] vehicleArray = gson.fromJson(jsonObject.getAsJsonArray("response"), Vehicle[].class);
|
||||
|
||||
for (Vehicle vehicle : vehicleArray) {
|
||||
@ -343,7 +342,7 @@ public class TeslaAccountHandler extends BaseBridgeHandler {
|
||||
}
|
||||
|
||||
try {
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
logger.trace("Request : {}:{}:{} yields {}", command, payLoad, target, jsonObject.get("response"));
|
||||
return jsonObject.get("response").toString();
|
||||
} catch (Exception e) {
|
||||
|
@ -137,7 +137,6 @@ public class TeslaVehicleHandler extends BaseThingHandler {
|
||||
protected ScheduledFuture<?> slowStateJob;
|
||||
|
||||
private final Gson gson = new Gson();
|
||||
private final JsonParser parser = new JsonParser();
|
||||
|
||||
public TeslaVehicleHandler(Thing thing, ClientBuilder clientBuilder) {
|
||||
super(thing);
|
||||
@ -711,7 +710,7 @@ public class TeslaVehicleHandler extends BaseThingHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(response.readEntity(String.class)).getAsJsonObject();
|
||||
Vehicle[] vehicleArray = gson.fromJson(jsonObject.getAsJsonArray("response"), Vehicle[].class);
|
||||
|
||||
for (Vehicle vehicle : vehicleArray) {
|
||||
@ -831,7 +830,7 @@ public class TeslaVehicleHandler extends BaseThingHandler {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
jsonObject = parser.parse(result).getAsJsonObject();
|
||||
jsonObject = JsonParser.parseString(result).getAsJsonObject();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class TibberHandler extends BaseThingHandler {
|
||||
String jsonResponse = HttpUtil.executeUrl("POST", BASE_URL, httpHeader, inputStream, null,
|
||||
REQUEST_TIMEOUT);
|
||||
|
||||
JsonObject object = (JsonObject) new JsonParser().parse(jsonResponse);
|
||||
JsonObject object = (JsonObject) JsonParser.parseString(jsonResponse);
|
||||
rtEnabled = object.getAsJsonObject("data").getAsJsonObject("viewer").getAsJsonObject("home")
|
||||
.getAsJsonObject("features").get("realTimeConsumptionEnabled").toString();
|
||||
|
||||
@ -152,7 +152,7 @@ public class TibberHandler extends BaseThingHandler {
|
||||
updateStatus(ThingStatus.ONLINE);
|
||||
}
|
||||
|
||||
JsonObject object = (JsonObject) new JsonParser().parse(jsonResponse);
|
||||
JsonObject object = (JsonObject) JsonParser.parseString(jsonResponse);
|
||||
|
||||
if (jsonResponse.contains("total")) {
|
||||
try {
|
||||
@ -434,7 +434,7 @@ public class TibberHandler extends BaseThingHandler {
|
||||
logger.debug("Error/terminate received from server: {}", message);
|
||||
close();
|
||||
} else if (message.contains("liveMeasurement")) {
|
||||
JsonObject object = (JsonObject) new JsonParser().parse(message);
|
||||
JsonObject object = (JsonObject) JsonParser.parseString(message);
|
||||
JsonObject myObject = object.getAsJsonObject("payload").getAsJsonObject("data")
|
||||
.getAsJsonObject("liveMeasurement");
|
||||
if (myObject.has("timestamp")) {
|
||||
|
@ -148,9 +148,8 @@ public class TouchWandWebSockets {
|
||||
@OnWebSocketMessage
|
||||
public void onMessage(String msg) {
|
||||
TouchWandUnitData touchWandUnit;
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
try {
|
||||
JsonObject unitObj = jsonParser.parse(msg).getAsJsonObject();
|
||||
JsonObject unitObj = JsonParser.parseString(msg).getAsJsonObject();
|
||||
boolean eventUnitChanged = unitObj.get("type").getAsString().equals("UNIT_CHANGED");
|
||||
if (!eventUnitChanged) {
|
||||
return;
|
||||
|
@ -81,9 +81,8 @@ public class TouchWandUnitDiscoveryService extends AbstractDiscoveryService
|
||||
return;
|
||||
}
|
||||
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
try {
|
||||
JsonArray jsonArray = jsonParser.parse(response).getAsJsonArray();
|
||||
JsonArray jsonArray = JsonParser.parseString(response).getAsJsonArray();
|
||||
if (jsonArray.isJsonArray()) {
|
||||
try {
|
||||
for (JsonElement unit : jsonArray) {
|
||||
|
@ -85,11 +85,10 @@ public class TouchWandUnitFromJson {
|
||||
}
|
||||
|
||||
public static TouchWandUnitData parseResponse(String JsonUnit) {
|
||||
final JsonParser jsonParser = new JsonParser();
|
||||
TouchWandUnitData myTouchWandUnitData;
|
||||
JsonObject unitObj;
|
||||
try {
|
||||
unitObj = jsonParser.parse(JsonUnit).getAsJsonObject();
|
||||
unitObj = JsonParser.parseString(JsonUnit).getAsJsonObject();
|
||||
myTouchWandUnitData = parseResponse(unitObj);
|
||||
} catch (JsonParseException | IllegalStateException e) {
|
||||
logger.warn("Could not parse response {}", JsonUnit);
|
||||
|
@ -36,7 +36,6 @@ import com.google.gson.JsonParser;
|
||||
public class TradfriCoapHandler implements CoapHandler {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(TradfriCoapHandler.class);
|
||||
private final JsonParser parser = new JsonParser();
|
||||
|
||||
private @Nullable CoapCallback callback;
|
||||
private @Nullable CompletableFuture<String> future;
|
||||
@ -70,7 +69,7 @@ public class TradfriCoapHandler implements CoapHandler {
|
||||
final CoapCallback callback = this.callback;
|
||||
if (callback != null) {
|
||||
try {
|
||||
callback.onUpdate(parser.parse(response.getResponseText()));
|
||||
callback.onUpdate(JsonParser.parseString(response.getResponseText()));
|
||||
callback.setStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE);
|
||||
} catch (JsonParseException e) {
|
||||
logger.warn("Observed value is no valid json: {}, {}", response.getResponseText(), e.getMessage());
|
||||
|
@ -17,7 +17,11 @@ import static org.openhab.binding.tradfri.internal.TradfriBindingConstants.*;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -211,7 +215,7 @@ public class TradfriGatewayHandler extends BaseBridgeHandler implements CoapCall
|
||||
|
||||
if (gatewayResponse.isSuccess()) {
|
||||
responseText = gatewayResponse.getResponseText();
|
||||
json = new JsonParser().parse(responseText).getAsJsonObject();
|
||||
json = JsonParser.parseString(responseText).getAsJsonObject();
|
||||
preSharedKey = json.get(NEW_PSK_BY_GW).getAsString();
|
||||
|
||||
if (isNullOrEmpty(preSharedKey)) {
|
||||
@ -323,7 +327,7 @@ public class TradfriGatewayHandler extends BaseBridgeHandler implements CoapCall
|
||||
deviceClient.setURI(gatewayInfoURI);
|
||||
deviceClient.asyncGet().thenAccept(data -> {
|
||||
logger.debug("requestGatewayInfo response: {}", data);
|
||||
JsonObject json = new JsonParser().parse(data).getAsJsonObject();
|
||||
JsonObject json = JsonParser.parseString(data).getAsJsonObject();
|
||||
String firmwareVersion = json.get(VERSION).getAsString();
|
||||
getThing().setProperty(Thing.PROPERTY_FIRMWARE_VERSION, firmwareVersion);
|
||||
updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE);
|
||||
@ -337,7 +341,7 @@ public class TradfriGatewayHandler extends BaseBridgeHandler implements CoapCall
|
||||
deviceClient.setURI(gatewayURI + "/" + instanceId);
|
||||
deviceClient.asyncGet().thenAccept(data -> {
|
||||
logger.debug("requestDeviceDetails response: {}", data);
|
||||
JsonObject json = new JsonParser().parse(data).getAsJsonObject();
|
||||
JsonObject json = JsonParser.parseString(data).getAsJsonObject();
|
||||
deviceUpdateListeners.forEach(listener -> listener.onUpdate(instanceId, json));
|
||||
});
|
||||
// restore root URI
|
||||
|
@ -107,7 +107,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
@Test
|
||||
public void validDiscoveryResultWhiteLightW() {
|
||||
String json = "{\"9001\":\"TRADFRI bulb E27 W opal 1000lm\",\"9002\":1492856270,\"9020\":1507194357,\"9003\":65537,\"3311\":[{\"5850\":1,\"5851\":254,\"9003\":0}],\"9054\":0,\"5750\":2,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI bulb E27 W opal 1000lm\",\"2\":\"\",\"3\":\"1.2.214\",\"6\":1}}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65537", data);
|
||||
|
||||
@ -123,7 +123,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
@Test
|
||||
public void validDiscoveryResultWhiteLightWS() {
|
||||
String json = "{\"9001\":\"TRADFRI bulb E27 WS opal 980lm\",\"9002\":1492955148,\"9020\":1507200447,\"9003\":65537,\"3311\":[{\"5710\":26909,\"5850\":1,\"5851\":203,\"5707\":0,\"5708\":0,\"5709\":30140,\"5711\":370,\"5706\":\"f1e0b5\",\"9003\":0}],\"9054\":0,\"5750\":2,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI bulb E27 WS opal 980lm\",\"2\":\"\",\"3\":\"1.2.217\",\"6\":1}}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65537", data);
|
||||
|
||||
@ -141,7 +141,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
// We do not always receive a COLOR = "5706" attribute, even the light supports it - but the gateway does not
|
||||
// seem to have this information, if the bulb is unreachable.
|
||||
String json = "{\"9001\":\"TRADFRI bulb E27 WS opal 980lm\",\"9002\":1492955148,\"9020\":1506968670,\"9003\":65537,\"3311\":[{\"9003\":0}],\"9054\":0,\"5750\":2,\"9019\":0,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI bulb E27 WS opal 980lm\",\"2\":\"\",\"3\":\"1.2.217\",\"6\":1}}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65537", data);
|
||||
|
||||
@ -157,7 +157,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
@Test
|
||||
public void validDiscoveryResultColorLightCWS() {
|
||||
String json = "{\"9001\":\"TRADFRI bulb E27 CWS opal 600lm\",\"9002\":1505151864,\"9020\":1505433527,\"9003\":65550,\"9019\":1,\"9054\":0,\"5750\":2,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI bulb E27 CWS opal 600lm\",\"2\":\"\",\"3\":\"1.3.002\",\"6\":1},\"3311\":[{\"5850\":1,\"5708\":0,\"5851\":254,\"5707\":0,\"5709\":33137,\"5710\":27211,\"5711\":0,\"5706\":\"efd275\",\"9003\":0}]}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65550", data);
|
||||
|
||||
@ -173,7 +173,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
@Test
|
||||
public void validDiscoveryResultAlternativeColorLightCWS() {
|
||||
String json = "{\"3311\":[{\"5850\":1,\"5709\":32886,\"5851\":216,\"5707\":5309,\"5708\":52400,\"5710\":27217,\"5706\":\"efd275\",\"9003\":0}],\"9001\":\"Mushroom lamp\",\"9002\":1571036916,\"9020\":1571588312,\"9003\":65539,\"9054\":0,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI bulb E27 C\\/WS opal 600\",\"2\":\"\",\"3\":\"1.3.009\",\"6\":1},\"5750\":2}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65539", data);
|
||||
|
||||
@ -189,7 +189,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
@Test
|
||||
public void validDiscoveryResultRemoteControl() {
|
||||
String json = "{\"9001\":\"TRADFRI remote control\",\"9002\":1492843083,\"9020\":1506977986,\"9003\":65536,\"9054\":0,\"5750\":0,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI remote control\",\"2\":\"\",\"3\":\"1.2.214\",\"6\":3,\"9\":47},\"15009\":[{\"9003\":0}]}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65536", data);
|
||||
|
||||
@ -205,7 +205,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
@Test
|
||||
public void validDiscoveryResultWirelessDimmer() {
|
||||
String json = "{\"9001\":\"TRADFRI wireless dimmer\",\"9002\":1492843083,\"9020\":1506977986,\"9003\":65536,\"9054\":0,\"5750\":0,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI wireless dimmer\",\"2\":\"\",\"3\":\"1.2.214\",\"6\":3,\"9\":47},\"15009\":[{\"9003\":0}]}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65536", data);
|
||||
|
||||
@ -221,7 +221,7 @@ public class TradfriDiscoveryServiceTest {
|
||||
@Test
|
||||
public void validDiscoveryResultMotionSensor() {
|
||||
String json = "{\"9001\":\"TRADFRI motion sensor\",\"9002\":1492955083,\"9020\":1507120083,\"9003\":65538,\"9054\":0,\"5750\":4,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI motion sensor\",\"2\":\"\",\"3\":\"1.2.214\",\"6\":3,\"9\":60},\"3300\":[{\"9003\":0}]}";
|
||||
JsonObject data = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject data = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
discovery.onUpdate("65538", data);
|
||||
|
||||
|
@ -131,7 +131,7 @@ public class UniFiControllerRequest<T> {
|
||||
String json = getContent();
|
||||
// mgb: only try and unmarshall non-void result types
|
||||
if (!Void.class.equals(resultType)) {
|
||||
JsonObject jsonObject = new JsonParser().parse(json).getAsJsonObject();
|
||||
JsonObject jsonObject = JsonParser.parseString(json).getAsJsonObject();
|
||||
if (jsonObject.has(PROPERTY_DATA) && jsonObject.get(PROPERTY_DATA).isJsonArray()) {
|
||||
result = gson.fromJson(jsonObject.getAsJsonArray(PROPERTY_DATA), resultType);
|
||||
}
|
||||
@ -223,19 +223,19 @@ public class UniFiControllerRequest<T> {
|
||||
request = request.content(content);
|
||||
}
|
||||
|
||||
if (!csrfToken.isEmpty())
|
||||
if (!csrfToken.isEmpty()) {
|
||||
request.header("x-csrf-token", this.csrfToken);
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
private String getRequestBodyAsJson() {
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
JsonElement jsonElement = null;
|
||||
for (Entry<String, String> entry : bodyParameters.entrySet()) {
|
||||
try {
|
||||
jsonElement = jsonParser.parse(entry.getValue());
|
||||
jsonElement = JsonParser.parseString(entry.getValue());
|
||||
} catch (JsonSyntaxException e) {
|
||||
jsonElement = new JsonPrimitive(entry.getValue());
|
||||
}
|
||||
@ -245,8 +245,7 @@ public class UniFiControllerRequest<T> {
|
||||
}
|
||||
|
||||
private static String prettyPrintJson(String content) {
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonObject json = parser.parse(content).getAsJsonObject();
|
||||
JsonObject json = JsonParser.parseString(content).getAsJsonObject();
|
||||
Gson prettyGson = new GsonBuilder().setPrettyPrinting().create();
|
||||
return prettyGson.toJson(json);
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ public class UnifiedRemoteConnection {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(UnifiedRemoteConnection.class);
|
||||
private final String url;
|
||||
private final JsonParser jsonParser = new JsonParser();
|
||||
private HttpClient httpClient;
|
||||
private @Nullable String connectionID;
|
||||
private @Nullable String connectionGUID;
|
||||
@ -67,7 +66,7 @@ public class UnifiedRemoteConnection {
|
||||
connectionGUID = "web-" + UUID.randomUUID().toString();
|
||||
response = httpClient.newRequest(getPath("connect")).method(HttpMethod.GET)
|
||||
.timeout(TIMEOUT_SEC, TimeUnit.SECONDS).send();
|
||||
JsonObject responseBody = jsonParser.parse(response.getContentAsString()).getAsJsonObject();
|
||||
JsonObject responseBody = JsonParser.parseString(response.getContentAsString()).getAsJsonObject();
|
||||
connectionID = responseBody.get("id").getAsString();
|
||||
|
||||
String password = UUID.randomUUID().toString();
|
||||
@ -97,7 +96,7 @@ public class UnifiedRemoteConnection {
|
||||
|
||||
public ContentResponse mouseMove(String jsonIntArray)
|
||||
throws InterruptedException, ExecutionException, TimeoutException {
|
||||
JsonArray cordinates = jsonParser.parse(jsonIntArray).getAsJsonArray();
|
||||
JsonArray cordinates = JsonParser.parseString(jsonIntArray).getAsJsonArray();
|
||||
int x = cordinates.get(0).getAsInt();
|
||||
int y = cordinates.get(1).getAsInt();
|
||||
return this.execRemoteAction("Relmtech.Basic Input", "delta",
|
||||
@ -242,8 +241,9 @@ public class UnifiedRemoteConnection {
|
||||
Request request = httpClient.newRequest(getPath("request")).method(HttpMethod.POST).timeout(TIMEOUT_SEC,
|
||||
TimeUnit.SECONDS);
|
||||
request.header(HttpHeader.CONTENT_TYPE, "application/json");
|
||||
if (connectionID != null)
|
||||
if (connectionID != null) {
|
||||
request.header(CONNECTION_ID_HEADER, connectionID);
|
||||
}
|
||||
String stringContent = content.toString();
|
||||
logger.debug("[Request Payload {} ]", stringContent);
|
||||
request.content(new StringContentProvider(stringContent, "utf-8"));
|
||||
|
@ -60,7 +60,6 @@ public class WindcentraleHandler extends BaseThingHandler {
|
||||
private static final long CACHE_EXPIRY = TimeUnit.SECONDS.toMillis(5);
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(WindcentraleHandler.class);
|
||||
private final JsonParser parser = new JsonParser();
|
||||
|
||||
private @Nullable MillConfig millConfig;
|
||||
private @Nullable String millUrl;
|
||||
@ -127,7 +126,7 @@ public class WindcentraleHandler extends BaseThingHandler {
|
||||
return;
|
||||
}
|
||||
logger.trace("Retrieved updated mill data: {}", rawMillData);
|
||||
final JsonElement jsonElement = parser.parse(rawMillData);
|
||||
final JsonElement jsonElement = JsonParser.parseString(rawMillData);
|
||||
|
||||
if (!(jsonElement instanceof JsonObject)) {
|
||||
throw new JsonParseException("Could not parse windmill json data");
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -224,8 +224,7 @@ public class YIOremoteDockHandler extends BaseThingHandler {
|
||||
|
||||
private JsonObject convertStringToJsonObject(String jsonString) {
|
||||
try {
|
||||
JsonParser parser = new JsonParser();
|
||||
JsonElement jsonElement = parser.parse(jsonString);
|
||||
JsonElement jsonElement = JsonParser.parseString(jsonString);
|
||||
JsonObject result;
|
||||
|
||||
if (jsonElement instanceof JsonObject) {
|
||||
|
@ -114,7 +114,7 @@ public class UsersAndConfigTests {
|
||||
response = commonSetup.client.target(commonSetup.basePath).request().post(Entity.json(body));
|
||||
assertThat(response.getStatus(), is(200));
|
||||
|
||||
JsonElement e = new JsonParser().parse(response.readEntity(String.class)).getAsJsonArray().get(0);
|
||||
JsonElement e = JsonParser.parseString(response.readEntity(String.class)).getAsJsonArray().get(0);
|
||||
e = e.getAsJsonObject().get("success");
|
||||
HueSuccessResponseCreateUser rc = commonSetup.cs.gson.fromJson(e, HueSuccessResponseCreateUser.class);
|
||||
assertNotNull(rc);
|
||||
|
@ -147,8 +147,7 @@ public class NeeoApi implements AutoCloseable {
|
||||
throw resp.createException();
|
||||
}
|
||||
|
||||
final JsonParser parser = new JsonParser();
|
||||
final JsonObject root = parser.parse(resp.getContent()).getAsJsonObject();
|
||||
final JsonObject root = JsonParser.parseString(resp.getContent()).getAsJsonObject();
|
||||
for (Map.Entry<String, JsonElement> room : root.getAsJsonObject("rooms").entrySet()) {
|
||||
final JsonObject roomObj = (JsonObject) room.getValue();
|
||||
|
||||
|
@ -83,8 +83,7 @@ public class NeeoDeviceKeys {
|
||||
|
||||
uidToKey.clear();
|
||||
|
||||
final JsonParser parser = new JsonParser();
|
||||
final JsonObject root = parser.parse(resp.getContent()).getAsJsonObject();
|
||||
final JsonObject root = JsonParser.parseString(resp.getContent()).getAsJsonObject();
|
||||
for (Map.Entry<String, JsonElement> room : root.getAsJsonObject("rooms").entrySet()) {
|
||||
final JsonObject roomObj = (JsonObject) room.getValue();
|
||||
for (Map.Entry<String, JsonElement> dev : roomObj.getAsJsonObject("devices").entrySet()) {
|
||||
|
@ -37,6 +37,12 @@
|
||||
<version>2.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.dfki.lt.jtok</groupId>
|
||||
<artifactId>jtok-core</artifactId>
|
||||
|
@ -16,7 +16,6 @@ Fragment-Host: org.openhab.binding.astro
|
||||
org.osgi.service.event;version='[1.4.0,1.4.1)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
slf4j.api;version='[1.7.25,1.7.26)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.3,1.0.4)',\
|
||||
tec.uom.se;version='[1.0.10,1.0.11)',\
|
||||
@ -44,4 +43,5 @@ Fragment-Host: org.openhab.binding.astro
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
org.apache.commons.lang3;version='[3.9.0,3.9.1)'
|
||||
com.google.gson;version='[2.8.6,2.8.7)',\
|
||||
org.apache.commons.lang3;version='[3.12.0,3.12.1)'
|
||||
|
@ -22,7 +22,6 @@ Fragment-Host: org.openhab.binding.avmfritz
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
org.jupnp;version='[2.5.2,2.5.3)',\
|
||||
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.3,1.0.4)',\
|
||||
tec.uom.se;version='[1.0.10,1.0.11)',\
|
||||
org.eclipse.jetty.client;version='[9.4.20,9.4.21)',\
|
||||
@ -68,4 +67,5 @@ Fragment-Host: org.openhab.binding.avmfritz
|
||||
org.mockito.mockito-core;version='[3.7.0,3.7.1)',\
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
@ -20,7 +20,6 @@ Fragment-Host: org.openhab.binding.feed
|
||||
# done
|
||||
#
|
||||
-runbundles: \
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.felix.scr;version='[2.1.10,2.1.11)',\
|
||||
org.osgi.service.event;version='[1.4.0,1.4.1)',\
|
||||
@ -71,4 +70,5 @@ Fragment-Host: org.openhab.binding.feed
|
||||
junit-platform-engine;version='[1.7.0,1.7.1)',\
|
||||
junit-platform-launcher;version='[1.7.0,1.7.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
@ -17,7 +17,6 @@ Fragment-Host: org.openhab.binding.hue
|
||||
#
|
||||
-runbundles: \
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
@ -72,4 +71,5 @@ Fragment-Host: org.openhab.binding.hue
|
||||
junit-platform-engine;version='[1.7.0,1.7.1)',\
|
||||
junit-platform-launcher;version='[1.7.0,1.7.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
@ -18,7 +18,6 @@ Fragment-Host: org.openhab.binding.max
|
||||
-runbundles: \
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
@ -58,4 +57,5 @@ Fragment-Host: org.openhab.binding.max
|
||||
junit-platform-launcher;version='[1.7.0,1.7.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
org.apache.commons.lang3;version='[3.9.0,3.9.1)'
|
||||
com.google.gson;version='[2.8.6,2.8.7)',\
|
||||
org.apache.commons.lang3;version='[3.12.0,3.12.1)'
|
||||
|
@ -32,7 +32,6 @@ Fragment-Host: org.openhab.binding.modbus
|
||||
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
|
||||
org.osgi.service.event;version='[1.4.0,1.4.1)',\
|
||||
slf4j.api;version='[1.7.25,1.7.26)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.3,1.0.4)',\
|
||||
tec.uom.se;version='[1.0.10,1.0.11)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
@ -75,4 +74,5 @@ Fragment-Host: org.openhab.binding.modbus
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.mockito.junit-jupiter;version='[3.7.0,3.7.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
@ -20,7 +20,6 @@ Fragment-Host: org.openhab.binding.nest
|
||||
-runbundles: \
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.aries.javax.jax.rs-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
@ -87,4 +86,5 @@ Fragment-Host: org.openhab.binding.nest
|
||||
org.mockito.mockito-core;version='[3.7.0,3.7.1)',\
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
@ -18,7 +18,6 @@ Fragment-Host: org.openhab.binding.ntp
|
||||
-runbundles: \
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.commons.commons-net;version='[3.7.2,3.7.3)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
@ -62,4 +61,5 @@ Fragment-Host: org.openhab.binding.ntp
|
||||
org.mockito.mockito-core;version='[3.7.0,3.7.1)',\
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
@ -18,7 +18,6 @@ Fragment-Host: org.openhab.binding.systeminfo
|
||||
# done
|
||||
#
|
||||
-runbundles: \
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
@ -66,4 +65,5 @@ Fragment-Host: org.openhab.binding.systeminfo
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
org.apache.commons.lang3;version='[3.9.0,3.9.1)'
|
||||
com.google.gson;version='[2.8.6,2.8.7)',\
|
||||
org.apache.commons.lang3;version='[3.12.0,3.12.1)'
|
||||
|
@ -23,7 +23,6 @@ Fragment-Host: org.openhab.binding.tradfri
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
slf4j.api;version='[1.7.25,1.7.26)',\
|
||||
org.eclipse.equinox.event;version='[1.4.300,1.4.301)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.jmdns;version='[3.5.6,3.5.7)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
tec.uom.lib.uom-lib-common;version='[1.0.3,1.0.4)',\
|
||||
@ -68,4 +67,5 @@ Fragment-Host: org.openhab.binding.tradfri
|
||||
org.mockito.mockito-core;version='[3.7.0,3.7.1)',\
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
@ -17,7 +17,6 @@ Fragment-Host: org.openhab.binding.wemo
|
||||
#
|
||||
-runbundles: \
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
@ -77,4 +76,5 @@ Fragment-Host: org.openhab.binding.wemo
|
||||
org.objenesis;version='[3.1.0,3.1.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
org.apache.commons.lang3;version='[3.9.0,3.9.1)'
|
||||
com.google.gson;version='[2.8.6,2.8.7)',\
|
||||
org.apache.commons.lang3;version='[3.12.0,3.12.1)'
|
||||
|
@ -18,7 +18,6 @@ Fragment-Host: org.openhab.persistence.mapdb
|
||||
-runbundles: \
|
||||
ch.qos.logback.classic;version='[1.2.3,1.2.4)',\
|
||||
ch.qos.logback.core;version='[1.2.3,1.2.4)',\
|
||||
com.google.gson;version='[2.8.2,2.8.3)',\
|
||||
javax.measure.unit-api;version='[1.0.0,1.0.1)',\
|
||||
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
|
||||
org.apache.felix.scr;version='[2.1.10,2.1.11)',\
|
||||
@ -50,4 +49,5 @@ Fragment-Host: org.openhab.persistence.mapdb
|
||||
junit-platform-engine;version='[1.7.0,1.7.1)',\
|
||||
junit-platform-launcher;version='[1.7.0,1.7.1)',\
|
||||
org.glassfish.hk2.osgi-resource-locator;version='[1.0.3,1.0.4)',\
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)'
|
||||
biz.aQute.tester.junit-platform;version='[5.3.0,5.3.1)',\
|
||||
com.google.gson;version='[2.8.6,2.8.7)'
|
||||
|
Loading…
x
Reference in New Issue
Block a user