From b58ba745652e4fb435ddf0f5e3cacc2a85c4c8c9 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Wed, 18 May 2016 12:45:09 +0200 Subject: [PATCH] the column name must be the same as the bean attribute name otherwise NPE Signed-off-by: Michael Hirsch --- .../eclipse/hawkbit/simulator/ui/SimulatorView.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java index bd6ecbe8b..4834bece9 100644 --- a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java +++ b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java @@ -53,11 +53,13 @@ import com.vaadin.ui.renderers.ProgressBarRenderer; * */ @SpringView(name = "") +// The inheritance comes from Vaadin +@SuppressWarnings("squid:MaximumInheritanceDepth") public class SimulatorView extends VerticalLayout implements View { private static final String NEXT_POLL_COUNTER_SEC_COL = "nextPollCounterSec"; - private static final String RESPONSE_STATUS_COL = "responseStatus"; + private static final String RESPONSE_STATUS_COL = "updateStatus"; private static final String PROTOCOL_COL = "protocol"; @@ -141,10 +143,9 @@ public class SimulatorView extends VerticalLayout implements View { responseComboBox.setItemIcon(ResponseStatus.ERROR, FontAwesome.EXCLAMATION_CIRCLE); responseComboBox.setNullSelectionAllowed(false); responseComboBox.setValue(ResponseStatus.SUCCESSFUL); - responseComboBox.addValueChangeListener(valueChangeEvent -> { - beanContainer.getItemIds().forEach(itemId -> beanContainer.getItem(itemId) - .getItemProperty(RESPONSE_STATUS_COL).setValue(valueChangeEvent.getProperty().getValue())); - }); + responseComboBox.addValueChangeListener( + valueChangeEvent -> beanContainer.getItemIds().forEach(itemId -> beanContainer.getItem(itemId) + .getItemProperty(RESPONSE_STATUS_COL).setValue(valueChangeEvent.getProperty().getValue()))); // add all components addComponent(caption);