[threeten-dev] [threeten-develop] Default Method in ChronoLocalDate and usage in LocalDate Question
James Gough
jpgough at gmail.com
Wed Jan 15 00:46:03 PST 2014
:-) - In the case why is it even overridden?
Jim
On 15 January 2014 08:28, Stephen Colebourne <scolebourne at joda.org> wrote:
> Looks like a cut and paste error in the comment to me...
> Stephen
>
> On 15 January 2014 09:58, James Gough <jpgough at gmail.com> wrote:
> > Hi,
> >
> > This is a question about default methods in java.time in 1.8.0-ea. In
> > ChronoLocalDate interface the format method is a default method:
> >
> > default String format(DateTimeFormatter formatter) {
> > Objects.requireNonNull(formatter, "formatter");
> > return formatter.format(this);
> > }
> >
> > In LocalDate this default method is overridden with:
> >
> > @Override // override for Javadoc and performance
> > public String format(DateTimeFormatter formatter) {
> > Objects.requireNonNull(formatter, "formatter");
> > return formatter.format(this);
> > }
> >
> > What is the performance benefit of doing this? As it's the same code why
> > would we not just use the default method implementation?
> >
> > Regards,
> > Jim
> >
> >
> ------------------------------------------------------------------------------
> > CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> > Learn Why More Businesses Are Choosing CenturyLink Cloud For
> > Critical Workloads, Development Environments & Everything In Between.
> > Get a Quote or Start a Free Trial Today.
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> > _______________________________________________
> > threeten-develop mailing list
> > threeten-develop at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/threeten-develop
> >
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> 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