Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
698fa8ee
Commit
698fa8ee
authored
Mar 21, 2016
by
Feng Xiao
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1335 from pradeepg26/master
Allow custom URLs for Any in JsonFormat
parents
92091363
4d98369f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
JsonFormat.java
...il/src/main/java/com/google/protobuf/util/JsonFormat.java
+3
-4
No files found.
java/util/src/main/java/com/google/protobuf/util/JsonFormat.java
View file @
698fa8ee
...
...
@@ -951,16 +951,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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment