From 32b94fef51cf6c76a21f8d1c321ef123ea26c94e Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Mon, 17 Jun 2024 15:33:54 -0700 Subject: [PATCH] Cleanup imports and comments in V3 stubs. PiperOrigin-RevId: 644154501 --- .../google/protobuf/GeneratedMessageV3.java | 23 ++++++++----------- .../protobuf/RepeatedFieldBuilderV3.java | 2 +- .../google/protobuf/SingleFieldBuilderV3.java | 4 +--- 3 files changed, 12 insertions(+), 17 deletions(-) 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 35f0898b76..9071495866 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java @@ -1,5 +1,5 @@ // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2024 Google LLC. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at @@ -9,13 +9,6 @@ package com.google.protobuf; import java.util.List; -import com.google.protobuf.Descriptors.Descriptor; -import com.google.protobuf.Descriptors.FieldDescriptor; -import com.google.protobuf.Extension.ExtensionType; -import com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder; -import com.google.protobuf.GeneratedMessage.ExtensionDescriptorRetriever; -import com.google.protobuf.GeneratedMessage.FieldAccessorTable; - /** * Stub for GeneratedMessageV3 wrapping GeneratedMessage for compatibility with older gencode. * @@ -48,7 +41,7 @@ public abstract class GeneratedMessageV3 extends GeneratedMessage { MessageT extends ExtendableMessage, BuilderT extends ExtendableBuilder> extends GeneratedMessage.ExtendableBuilder - implements ExtendableMessageOrBuilder { + implements GeneratedMessage.ExtendableMessageOrBuilder { protected ExtendableBuilder() { super(); } @@ -57,13 +50,15 @@ public abstract class GeneratedMessageV3 extends GeneratedMessage { super(parent); } - // Support old gencode override method removed in cl/597677225 + // Support old gencode override method removed in + // https://github.com/protocolbuffers/protobuf/commit/7bff169d32710b143951ec6ce2c4ea9a56e2ad24 public BuilderT setExtension( final GeneratedMessage.GeneratedExtension extension, final T value) { return setExtension((ExtensionLite) extension, value); } - // Support old gencode override method removed in cl/597677225 + // Support old gencode override method removed in + // https://github.com/protocolbuffers/protobuf/commit/7bff169d32710b143951ec6ce2c4ea9a56e2ad24 public BuilderT setExtension( final GeneratedMessage.GeneratedExtension> extension, final int index, @@ -71,13 +66,15 @@ public abstract class GeneratedMessageV3 extends GeneratedMessage { return setExtension((ExtensionLite>) extension, index, value); } - // Support old gencode override method removed in cl/597677225 + // Support old gencode override method removed in + // https://github.com/protocolbuffers/protobuf/commit/7bff169d32710b143951ec6ce2c4ea9a56e2ad24 public BuilderT addExtension( final GeneratedMessage.GeneratedExtension> extension, final T value) { return addExtension((ExtensionLite>) extension, value); } - // Support old gencode override method removed in cl/597677225 + // Support old gencode override method removed in + // https://github.com/protocolbuffers/protobuf/commit/7bff169d32710b143951ec6ce2c4ea9a56e2ad24 public BuilderT clearExtension( final GeneratedMessage.GeneratedExtension extension) { return clearExtension((ExtensionLite) extension); diff --git a/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java b/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java index ff807586f0..14a47a5d46 100644 --- a/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java +++ b/java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java @@ -1,5 +1,5 @@ // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2024 Google LLC. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at diff --git a/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java b/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java index b23941174c..3c6b151de2 100644 --- a/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java +++ b/java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java @@ -1,5 +1,5 @@ // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. +// Copyright 2024 Google LLC. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at @@ -7,8 +7,6 @@ package com.google.protobuf; -import static com.google.protobuf.Internal.checkNotNull; - /** * Stub for SingleFieldBuilderV3 wrapping SingleFieldBuilder for compatibility with older gencode. *