From 3ea568a9b6107ebf0d617c476f53a31490fd3182 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Mon, 7 Oct 2024 12:22:20 -0700 Subject: [PATCH] cherrypick restoration of mutableCopy helpers --- .../google/protobuf/GeneratedMessageV3.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java index 9816ee5383ff..3f7104028761 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java @@ -10,6 +10,11 @@ import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FieldDescriptor; import com.google.protobuf.Descriptors.OneofDescriptor; +import com.google.protobuf.Internal.BooleanList; +import com.google.protobuf.Internal.DoubleList; +import com.google.protobuf.Internal.FloatList; +import com.google.protobuf.Internal.IntList; +import com.google.protobuf.Internal.LongList; import java.util.List; /** @@ -36,6 +41,46 @@ protected GeneratedMessageV3(Builder builder) { super(builder); } + /* @deprecated This method is deprecated, and slated for removal in the next Java breaking change + * (5.x). Users should update gencode to >= 4.26.x which uses makeMutableCopy() instead. + */ + @Deprecated + protected static IntList mutableCopy(IntList list) { + return makeMutableCopy(list); + } + + /* @deprecated This method is deprecated, and slated for removal in the next Java breaking change + * (5.x). Users should update gencode to >= 4.26.x which uses makeMutableCopy() instead. + */ + @Deprecated + protected static LongList mutableCopy(LongList list) { + return makeMutableCopy(list); + } + + /* @deprecated This method is deprecated, and slated for removal in the next Java breaking change + * (5.x). Users should update gencode to >= 4.26.x which uses makeMutableCopy() instead. + */ + @Deprecated + protected static FloatList mutableCopy(FloatList list) { + return makeMutableCopy(list); + } + + /* @deprecated This method is deprecated, and slated for removal in the next Java breaking change + * (5.x). Users should update gencode to >= 4.26.x which uses makeMutableCopy() instead. + */ + @Deprecated + protected static DoubleList mutableCopy(DoubleList list) { + return makeMutableCopy(list); + } + + /* @deprecated This method is deprecated, and slated for removal in the next Java breaking change + * (5.x). Users should update gencode to >= 4.26.x which uses makeMutableCopy() instead. + */ + @Deprecated + protected static BooleanList mutableCopy(BooleanList list) { + return makeMutableCopy(list); + } + /* Overrides abstract GeneratedMessage.internalGetFieldAccessorTable(). * * @deprecated This method is deprecated, and slated for removal in the next Java breaking change