diff --git a/vavr/src/main/java/io/vavr/collection/HashArrayMappedTrie.java b/vavr/src/main/java/io/vavr/collection/HashArrayMappedTrie.java index 69bde5cbb..cbe9a765c 100644 --- a/vavr/src/main/java/io/vavr/collection/HashArrayMappedTrie.java +++ b/vavr/src/main/java/io/vavr/collection/HashArrayMappedTrie.java @@ -37,7 +37,9 @@ * * @author Ruslan Sennov */ -interface HashArrayMappedTrie extends Iterable> { +interface HashArrayMappedTrie extends Iterable>, Serializable { + + static final long serialVersionUID = 1L; static HashArrayMappedTrie empty() { return EmptyNode.instance(); @@ -167,6 +169,8 @@ private static AbstractNode getChild(AbstractNode node, int i */ abstract class AbstractNode implements HashArrayMappedTrie { + private static final long serialVersionUID = 1L; + static final int SIZE = 5; static final int BUCKET_SIZE = 1 << SIZE; static final int MAX_INDEX_NODE = BUCKET_SIZE >> 1; @@ -330,6 +334,8 @@ private Object readResolve() { */ abstract class LeafNode extends AbstractNode { + private static final long serialVersionUID = 1L; + abstract K key(); abstract V value(); diff --git a/vavr/src/main/java/io/vavr/collection/List.java b/vavr/src/main/java/io/vavr/collection/List.java index 1d3b2f50b..f343d8111 100644 --- a/vavr/src/main/java/io/vavr/collection/List.java +++ b/vavr/src/main/java/io/vavr/collection/List.java @@ -1803,6 +1803,7 @@ final class Cons implements List, Serializable { private static final long serialVersionUID = 1L; + @SuppressWarnings("serial") // Conditionally serializable private final T head; private final List tail; private final int length; diff --git a/vavr/src/main/java/io/vavr/collection/PriorityQueue.java b/vavr/src/main/java/io/vavr/collection/PriorityQueue.java index ac5a8421c..d836f6c1b 100644 --- a/vavr/src/main/java/io/vavr/collection/PriorityQueue.java +++ b/vavr/src/main/java/io/vavr/collection/PriorityQueue.java @@ -38,6 +38,7 @@ public final class PriorityQueue extends io.vavr.collection.AbstractQueue comparator; private final Seq> forest; private final int size; @@ -798,6 +799,7 @@ static final class Node implements Serializable { private static final long serialVersionUID = 1L; + @SuppressWarnings("serial") // Conditionally serializable final T root; final int rank; final Seq> children; diff --git a/vavr/src/main/java/io/vavr/collection/Stream.java b/vavr/src/main/java/io/vavr/collection/Stream.java index 651edaec3..6636815d9 100644 --- a/vavr/src/main/java/io/vavr/collection/Stream.java +++ b/vavr/src/main/java/io/vavr/collection/Stream.java @@ -1857,6 +1857,7 @@ abstract class Cons implements Stream { private static final long serialVersionUID = 1L; + @SuppressWarnings("serial") // Conditionally serializable final T head; final Lazy> tail;