From 420cebcd030a85b03304596fd23b530de086da70 Mon Sep 17 00:00:00 2001 From: Andrii Landiak Date: Thu, 21 Mar 2024 11:55:02 +0200 Subject: [PATCH] Use getDefaultProfileConfiguration instead of casting --- .../edge/rpc/constructor/tenant/TenantMsgConstructorV1.java | 3 +-- .../edge/rpc/constructor/tenant/TenantMsgConstructorV2.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV1.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV1.java index c6160c05bd..baa4a77b6b 100644 --- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV1.java +++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV1.java @@ -81,8 +81,7 @@ public class TenantMsgConstructorV1 implements TenantMsgConstructor { public TenantProfileUpdateMsg constructTenantProfileUpdateMsg(UpdateMsgType msgType, TenantProfile tenantProfile, EdgeVersion edgeVersion) { tenantProfile = JacksonUtil.clone(tenantProfile); // clear all config - DefaultTenantProfileConfiguration configuration = - (DefaultTenantProfileConfiguration) tenantProfile.getProfileData().getConfiguration(); + var configuration = tenantProfile.getDefaultProfileConfiguration(); configuration.setRpcTtlDays(0); configuration.setMaxJSExecutions(0); configuration.setMaxREExecutions(0); diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV2.java index 7ed36d9aef..274e18e7f3 100644 --- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV2.java +++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV2.java @@ -39,8 +39,7 @@ public class TenantMsgConstructorV2 implements TenantMsgConstructor { public TenantProfileUpdateMsg constructTenantProfileUpdateMsg(UpdateMsgType msgType, TenantProfile tenantProfile, EdgeVersion edgeVersion) { tenantProfile = JacksonUtil.clone(tenantProfile); // clear all config - DefaultTenantProfileConfiguration configuration = - (DefaultTenantProfileConfiguration) tenantProfile.getProfileData().getConfiguration(); + var configuration = tenantProfile.getDefaultProfileConfiguration(); configuration.setRpcTtlDays(0); configuration.setMaxJSExecutions(0); configuration.setMaxREExecutions(0);