Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(982)

Issue 9618044: Add support for Heterogeneous Schemata (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by ngmiceli
Modified:
10 years, 10 months ago
Reviewers:
yanivi
Base URL:
https://code.google.com/p/google-http-java-client/
Visibility:
Public.

Description

Add support for Heterogeneous Schemata https://code.google.com/p/google-http-java-client/issues/detail?id=173

Patch Set 1 #

Patch Set 2 : Added a working implementation #

Patch Set 3 : Fix to JSON string bug, add test case #

Total comments: 4

Patch Set 4 : Move logic into already-existing private methods #

Total comments: 15

Patch Set 5 : Comments; handle GenericJson #

Total comments: 40

Patch Set 6 : More comments and tweaks #

Patch Set 7 : #

Patch Set 8 : tiny #

Total comments: 2

Patch Set 9 : Review improvements #

Patch Set 10 : Javadoc & formatting #

Total comments: 30

Patch Set 11 : Review improvements #

Patch Set 12 : Parse all to GenericJson until type known, allow abstract, other improvements #

Total comments: 43

Patch Set 13 : More review feedback! #

Patch Set 14 : Formatting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+613 lines, -13 lines) Patch
M google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +403 lines, -2 lines 0 comments Download
M google-http-client/src/main/java/com/google/api/client/json/JsonParser.java View 1 2 3 4 5 6 7 8 9 10 11 12 12 chunks +133 lines, -11 lines 0 comments Download
A google-http-client/src/main/java/com/google/api/client/json/JsonPolymorphicTypeMap.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +63 lines, -0 lines 0 comments Download
M google-http-client/src/main/java/com/google/api/client/util/ClassInfo.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 16
yanivi
Great progress Nick! A few important comments to help guide you about things that will ...
10 years, 11 months ago (2013-05-25 11:37:19 UTC) #1
ngmiceli
I took your comments into consideration and moved the logic into the parseValue and parse ...
10 years, 11 months ago (2013-06-03 15:52:44 UTC) #2
yanivi
Good progress. Sorry I don't have time to investigate any more carefully than this, but ...
10 years, 11 months ago (2013-06-04 20:51:03 UTC) #3
ngmiceli
https://codereview.appspot.com/9618044/diff/14001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java File google-http-client/src/main/java/com/google/api/client/json/JsonParser.java (right): https://codereview.appspot.com/9618044/diff/14001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#newcode804 google-http-client/src/main/java/com/google/api/client/json/JsonParser.java:804: if (!cachedTypemapFields.containsKey(newInstanceClass)) { On 2013/06/04 20:51:03, yanivi wrote: > ...
10 years, 10 months ago (2013-06-10 17:16:48 UTC) #4
yanivi
https://codereview.appspot.com/9618044/diff/14001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java File google-http-client/src/main/java/com/google/api/client/json/JsonParser.java (right): https://codereview.appspot.com/9618044/diff/14001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#newcode804 google-http-client/src/main/java/com/google/api/client/json/JsonParser.java:804: if (!cachedTypemapFields.containsKey(newInstanceClass)) { On 2013/06/10 17:16:48, ngmiceli wrote: > ...
10 years, 10 months ago (2013-06-13 11:29:49 UTC) #5
ngmiceli
Since you've started reviewing small details and javadoc, I guess we should turn this from ...
10 years, 10 months ago (2013-06-14 22:04:46 UTC) #6
yanivi
I started writing some feedback, but I realized quickly that we're not going to get ...
10 years, 10 months ago (2013-06-17 17:04:12 UTC) #7
yanivi
https://codereview.appspot.com/9618044/diff/40001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java File google-http-client/src/main/java/com/google/api/client/json/JsonParser.java (right): https://codereview.appspot.com/9618044/diff/40001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#newcode966 google-http-client/src/main/java/com/google/api/client/json/JsonParser.java:966: cachedTypemapFields.put(key, field); throw IllegalARgumentException if Field doesn't have type ...
10 years, 10 months ago (2013-06-18 21:47:56 UTC) #8
yanivi
please add a link to https://code.google.com/p/google-http-java-client/issues/detail?id=173 in your changeset description
10 years, 10 months ago (2013-06-20 18:23:53 UTC) #9
ngmiceli
Yaniv and I discussed the next round of comments in person: 1) Add a test ...
10 years, 10 months ago (2013-06-21 15:02:48 UTC) #10
yanivi
https://codereview.appspot.com/9618044/diff/52001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java File google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java (right): https://codereview.appspot.com/9618044/diff/52001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java#newcode1446 google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java:1446: public static class Animal { ctrl-shift-f this file https://codereview.appspot.com/9618044/diff/52001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java#newcode1446 ...
10 years, 10 months ago (2013-06-24 15:41:57 UTC) #11
ngmiceli
https://codereview.appspot.com/9618044/diff/52001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java File google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java (right): https://codereview.appspot.com/9618044/diff/52001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java#newcode1446 google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java:1446: public static class Animal { On 2013/06/24 15:41:57, yanivi ...
10 years, 10 months ago (2013-06-26 21:22:41 UTC) #12
yanivi
hopefully this is the last round of comments... https://codereview.appspot.com/9618044/diff/75001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java File google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java (right): https://codereview.appspot.com/9618044/diff/75001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java#newcode1446 google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java:1446: public ...
10 years, 10 months ago (2013-06-27 13:55:58 UTC) #13
ngmiceli
https://codereview.appspot.com/9618044/diff/75001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java File google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java (right): https://codereview.appspot.com/9618044/diff/75001/google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java#newcode1446 google-http-client-test/src/main/java/com/google/api/client/test/json/AbstractJsonFactoryTest.java:1446: public static abstract class Animal { On 2013/06/27 13:55:58, ...
10 years, 10 months ago (2013-06-27 16:20:48 UTC) #14
yanivi
LGTM https://codereview.appspot.com/9618044/diff/75001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java File google-http-client/src/main/java/com/google/api/client/json/JsonParser.java (right): https://codereview.appspot.com/9618044/diff/75001/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#newcode908 google-http-client/src/main/java/com/google/api/client/json/JsonParser.java:908: HashSet<String> typeDefKeys = new HashSet<String>(); On 2013/06/27 16:20:48, ...
10 years, 10 months ago (2013-06-27 17:53:55 UTC) #15
ngmiceli
10 years, 10 months ago (2013-06-27 18:45:09 UTC) #16
On 2013/06/27 17:53:55, yanivi wrote:
> LGTM
> 
>
https://codereview.appspot.com/9618044/diff/75001/google-http-client/src/main...
> File
google-http-client/src/main/java/com/google/api/client/json/JsonParser.java
> (right):
> 
>
https://codereview.appspot.com/9618044/diff/75001/google-http-client/src/main...
>
google-http-client/src/main/java/com/google/api/client/json/JsonParser.java:908:
> HashSet<String> typeDefKeys = new HashSet<String>();
> On 2013/06/27 16:20:48, ngmiceli wrote:
> > On 2013/06/27 13:55:58, yanivi wrote:
> > > Sets.newHashSet()
> > 
> > Done... but I really don't see why this is necessary.
> 
> [fyi] for readability.  Quote from our internal style guide: "local variables
> are declared close to the point they are first used (within reason), to
minimize
> their scope"

No, you misread. That's definitely a good practice. It's using Sets.newHashSet
(which just calls new HashSet<T>()) instead of calling new HashSet<>() myself.
:)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b