diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/compiler/java/java_message.cc | 17 | ||||
-rw-r--r-- | src/google/protobuf/compiler/java/java_message_builder.cc | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/google/protobuf/compiler/java/java_message.cc b/src/google/protobuf/compiler/java/java_message.cc index 5715a432..722ef6f7 100644 --- a/src/google/protobuf/compiler/java/java_message.cc +++ b/src/google/protobuf/compiler/java/java_message.cc @@ -664,34 +664,34 @@ GenerateParseFromMethods(io::Printer* printer) { "}\n" "public static $classname$ parseFrom(java.io.InputStream input)\n" " throws java.io.IOException {\n" - " return PARSER.parseFrom(input);\n" + " return parseWithIOException(PARSER, input);" "}\n" "public static $classname$ parseFrom(\n" " java.io.InputStream input,\n" " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" " throws java.io.IOException {\n" - " return PARSER.parseFrom(input, extensionRegistry);\n" + " return parseWithIOException(PARSER, input, extensionRegistry);" "}\n" "public static $classname$ parseDelimitedFrom(java.io.InputStream input)\n" " throws java.io.IOException {\n" - " return PARSER.parseDelimitedFrom(input);\n" + " return parseDelimitedWithIOException(PARSER, input);" "}\n" "public static $classname$ parseDelimitedFrom(\n" " java.io.InputStream input,\n" " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" " throws java.io.IOException {\n" - " return PARSER.parseDelimitedFrom(input, extensionRegistry);\n" + " return parseDelimitedWithIOException(PARSER, input, extensionRegistry);" "}\n" "public static $classname$ parseFrom(\n" " com.google.protobuf.CodedInputStream input)\n" " throws java.io.IOException {\n" - " return PARSER.parseFrom(input);\n" + " return parseWithIOException(PARSER, input);" "}\n" "public static $classname$ parseFrom(\n" " com.google.protobuf.CodedInputStream input,\n" " com.google.protobuf.ExtensionRegistryLite extensionRegistry)\n" " throws java.io.IOException {\n" - " return PARSER.parseFrom(input, extensionRegistry);\n" + " return parseWithIOException(PARSER, input, extensionRegistry);" "}\n" "\n", "classname", name_resolver_->GetImmutableClassName(descriptor_)); @@ -1217,9 +1217,8 @@ GenerateParsingConstructor(io::Printer* printer) { "} catch (com.google.protobuf.InvalidProtocolBufferException e) {\n" " throw new RuntimeException(e.setUnfinishedMessage(this));\n" "} catch (java.io.IOException e) {\n" - " throw new RuntimeException(\n" - " new com.google.protobuf.InvalidProtocolBufferException(\n" - " e.getMessage()).setUnfinishedMessage(this));\n" + " throw new RuntimeException(new com.google.protobuf.InvalidProtocolBufferException(e)\n" + " .setUnfinishedMessage(this));\n" "} finally {\n"); printer->Indent(); diff --git a/src/google/protobuf/compiler/java/java_message_builder.cc b/src/google/protobuf/compiler/java/java_message_builder.cc index 72694119..5d535034 100644 --- a/src/google/protobuf/compiler/java/java_message_builder.cc +++ b/src/google/protobuf/compiler/java/java_message_builder.cc @@ -538,7 +538,7 @@ GenerateBuilderParsingMethods(io::Printer* printer) { " parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);\n" " } catch (com.google.protobuf.InvalidProtocolBufferException e) {\n" " parsedMessage = ($classname$) e.getUnfinishedMessage();\n" - " throw e;\n" + " throw e.unwrapIOException();\n" " } finally {\n" " if (parsedMessage != null) {\n" " mergeFrom(parsedMessage);\n" |