diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/SecretValue.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/SecretValue.java index 0237f9efdad..dad0fd335c3 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/SecretValue.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/SecretValue.java @@ -1,8 +1,11 @@ package org.ovirt.engine.core.common.utils; +import java.io.Serializable; import java.util.Objects; -public class SecretValue { +public class SecretValue implements Serializable { + private static final long serialVersionUID = -7894728002078425194L; + private T value; public T getValue() { diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/vm/VmSnapshotInfoPanel.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/vm/VmSnapshotInfoPanel.java index 404187eb7c3..6d605f0ed8f 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/vm/VmSnapshotInfoPanel.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/vm/VmSnapshotInfoPanel.java @@ -1,10 +1,14 @@ package org.ovirt.engine.ui.common.widget.uicommon.vm; +import java.math.BigInteger; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; import org.gwtbootstrap3.client.ui.Label; +import org.ovirt.engine.core.common.businessentities.network.NetworkInterface; +import org.ovirt.engine.core.common.businessentities.network.NetworkStatistics; import org.ovirt.engine.core.common.businessentities.network.VmInterfaceType; import org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; import org.ovirt.engine.core.common.businessentities.storage.Disk; @@ -266,8 +270,10 @@ protected Double getSpeed(VmNetworkInterface object) { AbstractTextColumn dropsColumn = new AbstractSumUpColumn() { @Override protected Double[] getRawValue(VmNetworkInterface object) { - Double receiveDrops = object != null ? object.getStatistics().getReceiveDrops().doubleValue() : null; - Double transmitDrops = object != null ? object.getStatistics().getTransmitDrops().doubleValue() : null; + Double receiveDrops = Optional.ofNullable(object).map(NetworkInterface::getStatistics) + .map(NetworkStatistics::getReceiveDrops).map(BigInteger::doubleValue).orElse(null); + Double transmitDrops = Optional.ofNullable(object).map(NetworkInterface::getStatistics) + .map(NetworkStatistics::getTransmitDrops).map(BigInteger::doubleValue).orElse(null); return new Double[] { receiveDrops, transmitDrops }; } };