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
d7339318
Commit
d7339318
authored
Aug 07, 2014
by
jieluo@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change java descriptor back to private
parent
83964a9a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
25 deletions
+5
-25
java_enum.cc
src/google/protobuf/compiler/java/java_enum.cc
+1
-1
java_file.cc
src/google/protobuf/compiler/java/java_file.cc
+1
-1
java_shared_code_generator.cc
...ogle/protobuf/compiler/java/java_shared_code_generator.cc
+3
-23
No files found.
src/google/protobuf/compiler/java/java_enum.cc
View file @
d7339318
...
...
@@ -231,7 +231,7 @@ void EnumGenerator::Generate(io::Printer* printer) {
"index"
,
SimpleItoa
(
descriptor_
->
index
()));
}
printer
->
Print
(
"return $immutable_package$.$descriptor_class$.
descriptor
\n
"
"return $immutable_package$.$descriptor_class$.
getDescriptor()
\n
"
" .getEnumTypes().get($index$);
\n
"
,
"immutable_package"
,
FileJavaPackage
(
descriptor_
->
file
(),
true
),
"descriptor_class"
,
...
...
src/google/protobuf/compiler/java/java_file.cc
View file @
d7339318
...
...
@@ -315,7 +315,7 @@ void FileGenerator::GenerateDescriptorInitializationCodeForImmutable(
" getDescriptor() {
\n
"
" return descriptor;
\n
"
"}
\n
"
"p
ublic
static com.google.protobuf.Descriptors.FileDescriptor
\n
"
"p
rivate
static com.google.protobuf.Descriptors.FileDescriptor
\n
"
" descriptor;
\n
"
"static {
\n
"
);
printer
->
Indent
();
...
...
src/google/protobuf/compiler/java/java_shared_code_generator.cc
View file @
d7339318
...
...
@@ -176,36 +176,16 @@ void SharedCodeGenerator::GenerateDescriptors(io::Printer* printer) {
// Invoke internalBuildGeneratedFileFrom() to build the file.
printer
->
Print
(
"com.google.protobuf.Descriptors.FileDescriptor
\n
"
" .internalBuildGeneratedFileFrom(descriptorData,
\n
"
);
" .internalBuildGeneratedFileFrom(descriptorData,
\n
"
" new com.google.protobuf.Descriptors.FileDescriptor[] {
\n
"
);
printer
->
Print
(
" $classname$.class,
\n
"
" new java.lang.String[] {
\n
"
,
"classname"
,
name_resolver_
->
GetDescriptorClassName
(
file_
));
for
(
int
i
=
0
;
i
<
dependencies
.
size
();
i
++
)
{
const
string
&
dependency
=
dependencies
[
i
].
second
;
printer
->
Print
(
// Here we load the dependency FileDescriptors lazily via Java
// reflection. This is to avoid breaking proto1 targets who have
// genproto dependencies for which we can't generate the descriptor
// class. They will compile fine but when users try to call reflection
// functions upon them it will fail. Users will have to get rid of
// genproto dependencies before they can use proto2 reflection on
// proto1 messages.
"
\"
$dependency$
\"
,
\n
"
,
" $dependency$.getDescriptor(),
\n
"
,
"dependency"
,
dependency
);
}
printer
->
Print
(
" }, new java.lang.String[] {
\n
"
);
for
(
int
i
=
0
;
i
<
dependencies
.
size
();
i
++
)
{
const
string
&
filename
=
dependencies
[
i
].
first
;
printer
->
Print
(
"
\"
$filename$
\"
,
\n
"
,
"filename"
,
filename
);
}
printer
->
Print
(
" }, assigner);
\n
"
);
}
...
...
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