Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: third_party/protobuf/java/core/src/main/java/com/google/protobuf/Parser.java

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/java/core/src/main/java/com/google/protobuf/Parser.java
diff --git a/third_party/protobuf/java/src/main/java/com/google/protobuf/Parser.java b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Parser.java
similarity index 93%
rename from third_party/protobuf/java/src/main/java/com/google/protobuf/Parser.java
rename to third_party/protobuf/java/core/src/main/java/com/google/protobuf/Parser.java
index 227c02b771daea5103ea68a3a512de908aab5387..6db6924727a7be3ca730284a2a88fa9d1ed97d5a 100644
--- a/third_party/protobuf/java/src/main/java/com/google/protobuf/Parser.java
+++ b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Parser.java
@@ -37,9 +37,20 @@ import java.io.InputStream;
*
* The implementation should be stateless and thread-safe.
*
+ * <p>All methods may throw {@link InvalidProtocolBufferException}. In the event of invalid data,
+ * like an encoding error, the cause of the thrown exception will be {@code null}. However, if an
+ * I/O problem occurs, an exception is thrown with an {@link IOException} cause.
+ *
* @author liujisi@google.com (Pherl Liu)
*/
public interface Parser<MessageType> {
+
+ // NB(jh): Other parts of the protobuf API that parse messages distinguish between an I/O problem
+ // (like failure reading bytes from a socket) and invalid data (encoding error) via the type of
+ // thrown exception. But it would be source-incompatible to make the methods in this interface do
+ // so since they were originally spec'ed to only throw InvalidProtocolBufferException. So callers
+ // must inspect the cause of the exception to distinguish these two cases.
+
/**
* Parses a message of {@code MessageType} from the input.
*

Powered by Google App Engine
This is Rietveld 408576698