From c51b4055654cf560e8e8a6571c87d52a97574770 Mon Sep 17 00:00:00 2001 From: lmw Date: Wed, 30 Mar 2022 20:34:28 +0800 Subject: [PATCH] [#8035] Missing serialVersionUID when class implements Serializable interface --- .../config/remote/request/ClientConfigMetricRequest.java | 4 +++- .../nacos/api/remote/ability/ServerRemoteAbility.java | 4 +++- .../main/java/com/alibaba/nacos/common/notify/Event.java | 6 ++++-- .../java/com/alibaba/nacos/naming/pojo/ClusterInfo.java | 4 +++- .../java/com/alibaba/nacos/naming/pojo/IpAddressInfo.java | 4 +++- .../com/alibaba/nacos/naming/pojo/ServiceDetailInfo.java | 4 +++- .../java/com/alibaba/nacos/naming/pojo/Subscribers.java | 4 +++- 7 files changed, 22 insertions(+), 8 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/config/remote/request/ClientConfigMetricRequest.java b/api/src/main/java/com/alibaba/nacos/api/config/remote/request/ClientConfigMetricRequest.java index 05dc30e86..72e7f68c0 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/remote/request/ClientConfigMetricRequest.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/remote/request/ClientConfigMetricRequest.java @@ -48,7 +48,9 @@ public class ClientConfigMetricRequest extends ServerRequest { } public static class MetricsKey implements Serializable { - + + private static final long serialVersionUID = -2731160029960311757L; + String type; String key; diff --git a/api/src/main/java/com/alibaba/nacos/api/remote/ability/ServerRemoteAbility.java b/api/src/main/java/com/alibaba/nacos/api/remote/ability/ServerRemoteAbility.java index 7a89a1ba8..cbf24e20c 100644 --- a/api/src/main/java/com/alibaba/nacos/api/remote/ability/ServerRemoteAbility.java +++ b/api/src/main/java/com/alibaba/nacos/api/remote/ability/ServerRemoteAbility.java @@ -26,7 +26,9 @@ import java.util.Objects; * @version $Id: ServerRemoteAbility.java, v 0.1 2021年01月24日 00:09 AM liuzunfei Exp $ */ public class ServerRemoteAbility implements Serializable { - + + private static final long serialVersionUID = -3069795759506428390L; + /** * if support remote connection. */ diff --git a/common/src/main/java/com/alibaba/nacos/common/notify/Event.java b/common/src/main/java/com/alibaba/nacos/common/notify/Event.java index a85628842..e5dc694f8 100644 --- a/common/src/main/java/com/alibaba/nacos/common/notify/Event.java +++ b/common/src/main/java/com/alibaba/nacos/common/notify/Event.java @@ -27,9 +27,11 @@ import java.util.concurrent.atomic.AtomicLong; */ @SuppressWarnings({"PMD.AbstractClassShouldStartWithAbstractNamingRule"}) public abstract class Event implements Serializable { - + + private static final long serialVersionUID = -3731383194964997493L; + private static final AtomicLong SEQUENCE = new AtomicLong(0); - + private final long sequence = SEQUENCE.getAndIncrement(); /** diff --git a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ClusterInfo.java b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ClusterInfo.java index a302413d7..26c2f3d45 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ClusterInfo.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ClusterInfo.java @@ -29,7 +29,9 @@ import java.util.Map; * @version $Id: ClusterInfo.java, v 0.1 2018-09-17 上午11:36 caogu.wyp Exp $$ */ public class ClusterInfo implements Serializable { - + + private static final long serialVersionUID = 2146881454057032105L; + private String clusterName; private AbstractHealthChecker healthChecker; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/pojo/IpAddressInfo.java b/naming/src/main/java/com/alibaba/nacos/naming/pojo/IpAddressInfo.java index 4f6b79497..e5ec81361 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/pojo/IpAddressInfo.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/pojo/IpAddressInfo.java @@ -26,7 +26,9 @@ import java.util.Map; * @version $Id: IpAddressInfo.java, v 0.1 2018-09-17 上午10:52 caogu.wyp Exp $$ */ public class IpAddressInfo implements Serializable { - + + private static final long serialVersionUID = 6961930421629345179L; + private boolean valid; private Map metadata; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceDetailInfo.java b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceDetailInfo.java index 7a5c93341..457d55110 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceDetailInfo.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceDetailInfo.java @@ -28,7 +28,9 @@ import java.util.Map; * @version $Id: ServiceDetailInfo.java, v 0.1 2018-09-17 上午10:47 caogu.wyp Exp $$ */ public class ServiceDetailInfo implements Serializable { - + + private static final long serialVersionUID = 6351606608785841722L; + private String namespace; private String serviceName; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/pojo/Subscribers.java b/naming/src/main/java/com/alibaba/nacos/naming/pojo/Subscribers.java index 54180b2b9..029d2c8ad 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/pojo/Subscribers.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/pojo/Subscribers.java @@ -26,7 +26,9 @@ import java.util.List; * @version $Id: Subscribers.java, v 0.1 2019-05-28 下午10:47 nicholas Exp $$ */ public class Subscribers implements Serializable { - + + private static final long serialVersionUID = -3075690233070417052L; + private List subscribers; public List getSubscribers() {