Merge pull request #10718 from stickfigure/main

Add serialVersionUID to ByteString and subclasses
pull/10803/head
Jerry Berg 2 years ago committed by GitHub
commit c7647cb04a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      java/core/src/main/java/com/google/protobuf/ByteString.java

@ -75,6 +75,7 @@ import java.util.NoSuchElementException;
*/
@CheckReturnValue
public abstract class ByteString implements Iterable<Byte>, 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 abstract class ByteString implements Iterable<Byte>, Serializable {
/** 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 @@ public abstract class ByteString implements Iterable<Byte>, Serializable {
// 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;

Loading…
Cancel
Save