From abee0ea2d9aa6b6a989c882b76a984c1dc02eef8 Mon Sep 17 00:00:00 2001 From: Andrew Shvayka Date: Wed, 22 Feb 2017 14:08:51 +0200 Subject: [PATCH] Minor code cleanup --- .../actors/device/DeviceActorMessageProcessor.java | 11 ++++------- .../server/dao/timeseries/SimpleListenableFuture.java | 4 ---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java index da2c62016a..d4c42d82b7 100644 --- a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java +++ b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java @@ -95,12 +95,10 @@ public class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcesso } private void refreshAttributes(DeviceAttributesEventNotificationMsg msg) { - if (this.deviceAttributes != null) { - if (msg.isDeleted()) { - msg.getDeletedKeys().forEach(key -> deviceAttributes.remove(key)); - } else { - deviceAttributes.update(msg.getScope(), msg.getValues()); - } + if (msg.isDeleted()) { + msg.getDeletedKeys().forEach(key -> deviceAttributes.remove(key)); + } else { + deviceAttributes.update(msg.getScope(), msg.getValues()); } } @@ -206,7 +204,6 @@ public class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcesso } void processAttributesUpdate(ActorContext context, DeviceAttributesEventNotificationMsg msg) { - //TODO: improve this procedure to fetch only changed attributes and support attributes deletion refreshAttributes(msg); Set keys = msg.getDeletedKeys(); if (attributeSubscriptions.size() > 0) { diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java index e10a40de5f..3f3e0314c3 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java +++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java @@ -22,10 +22,6 @@ import com.google.common.util.concurrent.AbstractFuture; */ public class SimpleListenableFuture extends AbstractFuture { - public SimpleListenableFuture() { - - } - public boolean set(V value) { return super.set(value); }