From 0edf18c90f520ba7b24d88d17fec9246a830d20d Mon Sep 17 00:00:00 2001 From: Simon Bernard Date: Thu, 10 Jun 2021 16:20:52 +0200 Subject: [PATCH] BootstrapConfig is no more Serializable. Using Manual serialization like default JSON one is the preferred way. --- .../leshan/server/bootstrap/BootstrapConfig.java | 14 ++++---------- .../eclipse/leshan/server/SerializationTests.java | 6 ------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java b/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java index 2eeec02997..81d35792c1 100644 --- a/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java +++ b/leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java @@ -15,7 +15,6 @@ *******************************************************************************/ package org.eclipse.leshan.server.bootstrap; -import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.EnumSet; @@ -42,9 +41,7 @@ * @see BootstrapConfigStore * @see DefaultBootstrapHandler */ -public class BootstrapConfig implements Serializable { - - private static final long serialVersionUID = 1L; +public class BootstrapConfig { /** * List of LWM2M path to delete. @@ -67,8 +64,7 @@ public class BootstrapConfig implements Serializable { public Map acls = new HashMap<>(); /** Server Configuration (object 1) as defined in LWM2M 1.0.x TS. */ - public static class ServerConfig implements Serializable { - private static final long serialVersionUID = 1L; + public static class ServerConfig { /** Used as link to associate server Object Instance. */ public int shortId; @@ -123,8 +119,7 @@ public String toString() { * One Object Instance SHOULD address a LwM2M Bootstrap-Server. These LwM2M Object Resources MUST only be changed by * a LwM2M Bootstrap-Server or Bootstrap from Smartcard and MUST NOT be accessible by any other LwM2M Server. */ - public static class ServerSecurity implements Serializable { - private static final long serialVersionUID = 1L; + public static class ServerSecurity { /** * Uniquely identifies the LwM2M Server or LwM2M Bootstrap-Server. The format of the CoAP URI is defined in @@ -252,8 +247,7 @@ public String toString() { *

* Access Control Object is used to check whether the LwM2M Server has access right for performing an operation. */ - public static class ACLConfig implements Serializable { - private static final long serialVersionUID = 1L; + public static class ACLConfig { /** The Object ID of the Object Instance for which ACL are applied. */ public int objectId; diff --git a/leshan-server-core/src/test/java/org/eclipse/leshan/server/SerializationTests.java b/leshan-server-core/src/test/java/org/eclipse/leshan/server/SerializationTests.java index 31183f09a4..67db8ab703 100644 --- a/leshan-server-core/src/test/java/org/eclipse/leshan/server/SerializationTests.java +++ b/leshan-server-core/src/test/java/org/eclipse/leshan/server/SerializationTests.java @@ -19,7 +19,6 @@ import java.util.Map; -import org.eclipse.leshan.server.bootstrap.BootstrapConfig; import org.eclipse.leshan.server.security.SecurityInfo; import org.junit.Test; @@ -30,11 +29,6 @@ public void ensure_SecurityInfo_is_serializable() { assertIsSerializable(SecurityInfo.class); } - @Test - public void ensure_BootstrapConfig_is_serializable() { - assertIsSerializable(BootstrapConfig.class); - } - private static void assertIsSerializable(Class clazz, String... excludes) { Map results = SerializationUtil.isSerializable(clazz, excludes);