diff --git a/java/core/src/main/java/com/google/protobuf/ByteString.java b/java/core/src/main/java/com/google/protobuf/ByteString.java index 0e03ebd14ee5..1acbad08b4a3 100644 --- a/java/core/src/main/java/com/google/protobuf/ByteString.java +++ b/java/core/src/main/java/com/google/protobuf/ByteString.java @@ -75,6 +75,7 @@ */ @CheckReturnValue public abstract class ByteString implements Iterable, Serializable { + private static final long serialVersionUID = 1L; /** * When two strings to be concatenated have a combined length shorter than this, we just copy @@ -945,6 +946,8 @@ public final String toStringUtf8() { /** Base class for leaf {@link ByteString}s (i.e. non-ropes). */ abstract static class LeafByteString extends ByteString { + private static final long serialVersionUID = 1L; + @Override protected final int getTreeDepth() { return 0; @@ -1603,7 +1606,6 @@ protected int getOffsetIntoBytes() { // Keep this class private to avoid deadlocks in classloading across threads as ByteString's // static initializer loads LiteralByteString and another thread loads BoundedByteString. private static final class BoundedByteString extends LiteralByteString { - private final int bytesOffset; private final int bytesLength;