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

Issue 295670043: Update DateIntervalInfo to the newer version of ResourceSink (Java) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 9 months ago by fabalbon
Modified:
7 years, 9 months ago
Reviewers:
sffc
Visibility:
Public.

Description

Update DateIntervalInfo to the newer version of ResourceSink (Java)

Patch Set 1 #

Total comments: 18

Patch Set 2 : Update DateIntervalInfo to new version of ResourceSink in (Java) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -101 lines) Patch
M main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java View 1 5 chunks +94 lines, -101 lines 0 comments Download

Messages

Total messages: 6
fabalbon
https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java File main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java (right): https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java#newcode419 main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java:419: private static final class DateIntervalSink extends UResource.Sink { The ...
7 years, 9 months ago (2016-06-30 04:12:01 UTC) #1
sffc
Looks good; just a couple suggestions. https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java File main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java (right): https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java#newcode419 main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java:419: private static final ...
7 years, 9 months ago (2016-06-30 05:34:46 UTC) #2
sffc
https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java File main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java (right): https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java#newcode451 main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java:451: continue; On 2016/06/30 05:34:46, sffc wrote: > Consider breaking ...
7 years, 9 months ago (2016-06-30 06:41:47 UTC) #3
fabalbon
https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java File main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java (right): https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java#newcode451 main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java:451: continue; On 2016/06/30 06:41:47, sffc wrote: > On 2016/06/30 ...
7 years, 9 months ago (2016-06-30 18:38:47 UTC) #4
fabalbon
Update DateIntervalInfo to new version of ResourceSink in (Java)
7 years, 9 months ago (2016-06-30 18:39:42 UTC) #5
sffc
7 years, 9 months ago (2016-06-30 20:54:11 UTC) #6
LGTM

https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm...
File main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java (right):

https://codereview.appspot.com/295670043/diff/1/main/classes/core/src/com/ibm...
main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java:451: continue;
On 2016/06/30 18:38:47, fabalbon wrote:
> On 2016/06/30 06:41:47, sffc wrote:
> > On 2016/06/30 05:34:46, sffc wrote:
> > > Consider breaking after INTERVAL_FORMATS_KEY is encountered so you don't
> spin
> > > your wheels looking at the other keys once you've found it.  (It's a tip
> > Markus
> > > gave me on one of my code reviews a few weeks ago.)
> > > 
> > > If INTERVAL_FORMATS_KEY is the only one you need, have you considered
> putting
> > > that path directly into the getAllItemsWithFallback?  That method might
not
> > work
> > > though since the value could be an alias.
> > 
> > On second thought, if the INTERVAL_FORMATS_KEY tables contain different data
> > going up through the parent bundles, breaking after you find one of those
keys
> > might cause you to not see all of the available data.  You can try adding
the
> > break and seeing if any test cases fail.
> > 
> > That being said, looking at the code in public void setup(ULocale locale),
it
> > seems to me that the data sink is going to be called multiple times to
handle
> > alias fallbacks.  Why not handle the aliases here automatically by passing
the
> > full path to getAllItemsWithFallback?
> 
> The reason why I'm loading the calendar_type (e.g. gregorian) table and not
the
> intervalFormats table directly is because in root intervalFormats can be an
> alias to another calendar type (e.g. chinese/intervalFormats ->
> gregorian/intervalFormats).
> 
> The data I have to load is the union of all the elements in intervalFormats
for
> the requested locale, it's fallbacks and all its aliases. If I request
> intervalFormats directly, I'll get the requested locale and its fallbacks, but
I
> won't have access to it's alias thus I won't be able to load the its data.
> That's the reason why I need to load the containing table.

Acknowledged.
Sign in to reply to this message.

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