aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/java/java_file.cc
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2015-05-21 14:28:59 -0700
committerGravatar Bo Yang <teboring@google.com>2015-05-21 19:32:02 -0700
commit5db217305f37a79eeccd70f000088a06ec82fcec (patch)
treebe53dcf0c0b47ef9178ab8a6fa5c1946ee84a28f /src/google/protobuf/compiler/java/java_file.cc
parent56095026ccc2f755a6fdb296e30c3ddec8f556a2 (diff)
down-integrate internal changes
Diffstat (limited to 'src/google/protobuf/compiler/java/java_file.cc')
-rw-r--r--src/google/protobuf/compiler/java/java_file.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/java/java_file.cc b/src/google/protobuf/compiler/java/java_file.cc
index 4a1f4529..68b47ee1 100644
--- a/src/google/protobuf/compiler/java/java_file.cc
+++ b/src/google/protobuf/compiler/java/java_file.cc
@@ -35,10 +35,10 @@
#include <google/protobuf/compiler/java/java_file.h>
#include <memory>
-#include <set>
#ifndef _SHARED_PTR_H
#include <google/protobuf/stubs/shared_ptr.h>
#endif
+#include <set>
#include <google/protobuf/compiler/java/java_context.h>
#include <google/protobuf/compiler/java/java_enum.h>
@@ -153,6 +153,12 @@ void CollectExtensions(const FileDescriptorProto& file_proto,
}
}
+// Compare two field descriptors, returning true if the first should come
+// before the second.
+bool CompareFieldsByName(const FieldDescriptor *a, const FieldDescriptor *b) {
+ return a->full_name() < b->full_name();
+}
+
// Our static initialization methods can become very, very large.
// So large that if we aren't careful we end up blowing the JVM's
// 64K bytes of bytecode/method. Fortunately, since these static
@@ -166,7 +172,6 @@ void MaybeRestartJavaMethod(io::Printer* printer,
int *method_num,
const char *chain_statement,
const char *method_decl) {
-
// The goal here is to stay under 64K bytes of jvm bytecode/method,
// since otherwise we hit a hardcoded limit in the jvm and javac will
// then fail with the error "code too large". This limit lets our
@@ -184,6 +189,7 @@ void MaybeRestartJavaMethod(io::Printer* printer,
}
}
+
} // namespace
FileGenerator::FileGenerator(const FileDescriptor* file, bool immutable_api)