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

Unified Diff: third_party/protobuf/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.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/InvalidProtocolBufferException.java
diff --git a/third_party/protobuf/java/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java
similarity index 92%
rename from third_party/protobuf/java/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java
rename to third_party/protobuf/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java
index 0a76105278fba5d2a2127117c99e36846017d659..85ce7b24ac8a116f876a0cd274368b40219c2a3a 100644
--- a/third_party/protobuf/java/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java
+++ b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java
@@ -46,6 +46,10 @@ public class InvalidProtocolBufferException extends IOException {
super(description);
}
+ public InvalidProtocolBufferException(IOException e) {
+ super(e.getMessage(), e);
+ }
+
/**
* Attaches an unfinished message to the exception to support best-effort
* parsing in {@code Parser} interface.
@@ -66,6 +70,14 @@ public class InvalidProtocolBufferException extends IOException {
return unfinishedMessage;
}
+ /**
+ * Unwraps the underlying {@link IOException} if this exception was caused by an I/O
+ * problem. Otherwise, returns {@code this}.
+ */
+ public IOException unwrapIOException() {
+ return getCause() instanceof IOException ? (IOException) getCause() : this;
+ }
+
static InvalidProtocolBufferException truncatedMessage() {
return new InvalidProtocolBufferException(
"While parsing a protocol message, the input ended unexpectedly " +

Powered by Google App Engine
This is Rietveld 408576698