aboutsummaryrefslogtreecommitdiffhomepage
path: root/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/util/src/main/java/com/google/protobuf/util/JsonFormat.java')
-rw-r--r--java/util/src/main/java/com/google/protobuf/util/JsonFormat.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
index d7bf34a4..76f3437a 100644
--- a/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
+++ b/java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
@@ -952,16 +952,15 @@ public class JsonFormat {
}
}
- private static final String TYPE_URL_PREFIX = "type.googleapis.com";
-
+
private static String getTypeName(String typeUrl)
throws InvalidProtocolBufferException {
String[] parts = typeUrl.split("/");
- if (parts.length != 2 || !parts[0].equals(TYPE_URL_PREFIX)) {
+ if (parts.length == 1) {
throw new InvalidProtocolBufferException(
"Invalid type url found: " + typeUrl);
}
- return parts[1];
+ return parts[parts.length - 1];
}
private static class ParserImpl {