Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
cc5a1bfe
Commit
cc5a1bfe
authored
Aug 25, 2015
by
Feng Xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the PARSER @Deprecated public.
(cherry-picking an intenral change).
parent
f4ef8fe3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
java_helpers.h
src/google/protobuf/compiler/java/java_helpers.h
+6
-0
java_message.cc
src/google/protobuf/compiler/java/java_message.cc
+5
-2
No files found.
src/google/protobuf/compiler/java/java_helpers.h
View file @
cc5a1bfe
...
...
@@ -310,6 +310,12 @@ inline bool SupportFieldPresence(const FileDescriptor* descriptor) {
return
descriptor
->
syntax
()
!=
FileDescriptor
::
SYNTAX_PROTO3
;
}
// Whether generate classes expose public PARSER instances.
inline
bool
ExposePublicParser
(
const
FileDescriptor
*
descriptor
)
{
// TODO(liujisi): Mark the PARSER private in 3.1.x releases.
return
descriptor
->
syntax
()
==
FileDescriptor
::
SYNTAX_PROTO2
;
}
// Whether unknown enum values are kept (i.e., not stored in UnknownFieldSet
// but in the message and can be queried using additional getters that return
// ints.
...
...
src/google/protobuf/compiler/java/java_message.cc
View file @
cc5a1bfe
...
...
@@ -1248,8 +1248,11 @@ GenerateParsingConstructor(io::Printer* printer) {
// ===================================================================
void
ImmutableMessageGenerator
::
GenerateParser
(
io
::
Printer
*
printer
)
{
printer
->
Print
(
"private static final com.google.protobuf.Parser<$classname$> PARSER =
\n
"
" new com.google.protobuf.AbstractParser<$classname$>() {
\n
"
,
"$visibility$ static final com.google.protobuf.Parser<$classname$>
\n
"
" PARSER = new com.google.protobuf.AbstractParser<$classname$>() {
\n
"
,
"visibility"
,
ExposePublicParser
(
descriptor_
->
file
())
?
"@java.lang.Deprecated public"
:
"private"
,
"classname"
,
descriptor_
->
name
());
printer
->
Indent
();
printer
->
Print
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment