[threeten-dev] [threeten-develop] #176 Cnveret ZoneRules from interface to calss
Stephen Colebourne
scolebourne at joda.org
Thu Dec 20 16:07:46 PST 2012
The rules for offsets are created and thrown away rapidly, whereas
ZoneId rules are cached. Thus I think we should keep the special
implementation for offsets (as a hidden inner class). It is likely to
have much better performance and garbage collection because it is
simpler.
At the very least, there should be a dedicated factory method, perhaps
setting fields to null rather than empty arrays.
ZoneRules.of(ZoneOffset)
The factory will need more Javadoc to describe what the parameters are
and how they describe the rules, but you don't need to do that now.
The limit of 15 zone rules is weird (my previous weird code), it
should be an even number, such as 16.
ZoneRules.of(...) factory needs to ensure that no nulls are passed in
any list. I suspect that this happens now, but there needs to be a
test for it.
ZoneOffsetTransition @return should say "not null".
It should also declare IllegalArgumentException being thrown.
ZoneOffsetTransitionRule @return should be before @throws.
"This method is intended for use for construction of {@code ZoneRules}."
might be better phrased as
"This factory is only intended for use when creating {@code ZoneRules}."
(both ZoneOffsetTransition and ZoneOffsetTransitionRule)
The variable SZR in Ser should be renamed to ZRULES.
Otherwise looks good. And I think its a better and more maintainable solution.
Stephen
On 20 December 2012 22:25, Xueming Shen <xueming.shen at oracle.com> wrote:
> Here is the webrev of the changes for #176
>
> http://cr.openjdk.java.net/~sherman/jdk8_threeten/zrules
>
> -Sherman
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> threeten-develop mailing list
> threeten-develop at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/threeten-develop
More information about the threeten-dev
mailing list