Skip to content

Commit

Permalink
Cleanup imports and comments in V3 stubs.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 644146189
  • Loading branch information
zhangskz committed Jun 17, 2024
1 parent 1e360a4 commit 270ca66
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
23 changes: 10 additions & 13 deletions java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,13 +9,6 @@

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.
*
Expand Down Expand Up @@ -48,7 +41,7 @@ public abstract static class ExtendableBuilder<
MessageT extends ExtendableMessage<MessageT>,
BuilderT extends ExtendableBuilder<MessageT, BuilderT>>
extends GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>
implements ExtendableMessageOrBuilder<MessageT> {
implements GeneratedMessage.ExtendableMessageOrBuilder<MessageT> {
protected ExtendableBuilder() {
super();
}
Expand All @@ -57,27 +50,31 @@ protected ExtendableBuilder(BuilderParent parent) {
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 <T> BuilderT setExtension(
final GeneratedMessage.GeneratedExtension<MessageT, T> extension, final T value) {
return setExtension((ExtensionLite<MessageT, T>) 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 <T> BuilderT setExtension(
final GeneratedMessage.GeneratedExtension<MessageT, List<T>> extension,
final int index,
final T value) {
return setExtension((ExtensionLite<MessageT, List<T>>) 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 <T> BuilderT addExtension(
final GeneratedMessage.GeneratedExtension<MessageT, List<T>> extension, final T value) {
return addExtension((ExtensionLite<MessageT, List<T>>) 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 <T> BuilderT clearExtension(
final GeneratedMessage.GeneratedExtension<MessageT, T> extension) {
return clearExtension((ExtensionLite<MessageT, T>) extension);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// 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
// https://developers.google.com/open-source/licenses/bsd

package com.google.protobuf;

import static com.google.protobuf.Internal.checkNotNull;

/**
* Stub for SingleFieldBuilderV3 wrapping SingleFieldBuilder for compatibility with older gencode.
*
Expand Down

0 comments on commit 270ca66

Please sign in to comment.