Skip to content

Commit 6a6ba52

Browse files
Update comment at the top of message.h and message_lite.h to document that it should only be extended by gencode and not user code.
This was already the intended state, this only updates the comment to clarify. PiperOrigin-RevId: 774911342
1 parent 795ab9d commit 6a6ba52

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/google/protobuf/message.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
// Sanjay Ghemawat, Jeff Dean, and others.
1111
//
1212
// Defines Message, the abstract interface implemented by non-lite
13-
// protocol message objects. Although it's possible to implement this
14-
// interface manually, most users will use the protocol compiler to
15-
// generate implementations.
13+
// protocol message objects.
14+
//
15+
// This is only intended to be extended by protoc created gencode or types
16+
// defined in the Protobuf runtime. It is not intended or supported for
17+
// application code to extend this class, and any protected methods may be
18+
// removed without being it being considered a breaking change as long as the
19+
// corresponding gencode does not use it.
1620
//
1721
// Example usage:
1822
//
@@ -180,7 +184,7 @@ class MessageReflectionFriend;
180184
namespace expr {
181185
class CelMapReflectionFriend; // field_backed_map_impl.cc
182186
class SudoMapReflectionFriend;
183-
}
187+
} // namespace expr
184188

185189
namespace internal {
186190
class MapFieldPrinterHelper; // text_format.cc

src/google/protobuf/message_lite.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
//
1313
// Defines MessageLite, the abstract interface implemented by all (lite
1414
// and non-lite) protocol message objects.
15+
//
16+
// This is only intended to be extended by protoc created gencode or types
17+
// defined in the Protobuf runtime. It is not intended or supported for
18+
// application code to extend this class, and any protected methods may be
19+
// removed without being it being considered a breaking change as long as the
20+
// corresponding gencode does not use it.
1521

1622
#ifndef GOOGLE_PROTOBUF_MESSAGE_LITE_H__
1723
#define GOOGLE_PROTOBUF_MESSAGE_LITE_H__

0 commit comments

Comments
 (0)