| Index: third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc
|
| diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc b/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc
|
| index efb5fd45655c342dabdc9aa23e18c7799a4979e8..e24894b1b95b18a019a5429f6467113597cc11fe 100644
|
| --- a/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc
|
| +++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc
|
| @@ -101,20 +101,6 @@ string FieldName(const FieldDescriptor* field) {
|
|
|
| } // namespace
|
|
|
| -void PrintGeneratedAnnotation(io::Printer* printer, char delimiter,
|
| - const string& annotation_file) {
|
| - if (annotation_file.empty()) {
|
| - return;
|
| - }
|
| - string ptemplate =
|
| - "@javax.annotation.Generated(value=\"protoc\", comments=\"annotations:";
|
| - ptemplate.push_back(delimiter);
|
| - ptemplate.append("annotation_file");
|
| - ptemplate.push_back(delimiter);
|
| - ptemplate.append("\")\n");
|
| - printer->Print(ptemplate.c_str(), "annotation_file", annotation_file);
|
| -}
|
| -
|
| string UnderscoresToCamelCase(const string& input, bool cap_next_letter) {
|
| string result;
|
| // Note: I distrust ctype.h due to locales.
|
| @@ -360,7 +346,6 @@ const char* BoxedPrimitiveTypeName(JavaType type) {
|
| return NULL;
|
| }
|
|
|
| -
|
| const char* FieldTypeName(FieldDescriptor::Type field_type) {
|
| switch (field_type) {
|
| case FieldDescriptor::TYPE_INT32 : return "INT32";
|
| @@ -416,9 +401,9 @@ string DefaultValue(const FieldDescriptor* field, bool immutable,
|
| "L";
|
| case FieldDescriptor::CPPTYPE_DOUBLE: {
|
| double value = field->default_value_double();
|
| - if (value == std::numeric_limits<double>::infinity()) {
|
| + if (value == numeric_limits<double>::infinity()) {
|
| return "Double.POSITIVE_INFINITY";
|
| - } else if (value == -std::numeric_limits<double>::infinity()) {
|
| + } else if (value == -numeric_limits<double>::infinity()) {
|
| return "Double.NEGATIVE_INFINITY";
|
| } else if (value != value) {
|
| return "Double.NaN";
|
| @@ -428,9 +413,9 @@ string DefaultValue(const FieldDescriptor* field, bool immutable,
|
| }
|
| case FieldDescriptor::CPPTYPE_FLOAT: {
|
| float value = field->default_value_float();
|
| - if (value == std::numeric_limits<float>::infinity()) {
|
| + if (value == numeric_limits<float>::infinity()) {
|
| return "Float.POSITIVE_INFINITY";
|
| - } else if (value == -std::numeric_limits<float>::infinity()) {
|
| + } else if (value == -numeric_limits<float>::infinity()) {
|
| return "Float.NEGATIVE_INFINITY";
|
| } else if (value != value) {
|
| return "Float.NaN";
|
| @@ -496,9 +481,9 @@ bool IsDefaultValueJavaDefault(const FieldDescriptor* field) {
|
| return field->default_value_float() == 0.0;
|
| case FieldDescriptor::CPPTYPE_BOOL:
|
| return field->default_value_bool() == false;
|
| - case FieldDescriptor::CPPTYPE_ENUM:
|
| - return field->default_value_enum()->number() == 0;
|
| +
|
| case FieldDescriptor::CPPTYPE_STRING:
|
| + case FieldDescriptor::CPPTYPE_ENUM:
|
| case FieldDescriptor::CPPTYPE_MESSAGE:
|
| return false;
|
|
|
| @@ -510,11 +495,6 @@ bool IsDefaultValueJavaDefault(const FieldDescriptor* field) {
|
| return false;
|
| }
|
|
|
| -bool IsByteStringWithCustomDefaultValue(const FieldDescriptor* field) {
|
| - return GetJavaType(field) == JAVATYPE_BYTES &&
|
| - field->default_value_string() != "";
|
| -}
|
| -
|
| const char* bit_masks[] = {
|
| "0x00000001",
|
| "0x00000002",
|
|
|