Please Review java.time static interface methods move to supporting class

Stephen Colebourne scolebourne at joda.org
Thu Oct 3 01:22:10 UTC 2013


I would agree that methods work best here although we do use constants
in other places (such as DTFormatter where it emphasises the
immutability)

I want to keep the Temporal prefix. Removing it from the static
classes does shorten code, but no other pluralized helper class
changes the name (eg. Collections, Objects).

Stephen


On 2 October 2013 22:16, roger riggs <roger.riggs at oracle.com> wrote:
> Hi Sherman,
>
> Most of the new static factories in util and streams are methods.
> For example, that return interfaces (like Comparable).
>
> I think they are more clearly factories when defined as methods, even if
> they return a constant value.
> For consistency, I would retain them as methods and to allow future
> additions
> to have parameters even though the current set does not have any with
> parameters.
>
> I would retain "Temporal" on all the interfaces and consider dropping
> Temporal from the TemporalAdjusters and TemporalQueries classes.
>
> Roger
>
>
>
> On 10/2/2013 2:43 PM, Xueming Shen wrote:
>>
>> Hi,
>>
>> While it might make sense to have method to return the adjuster for
>> TemporalAdjusters, is there any real benefit to have those parentheses
>> for TemporalQueries? Maybe it can just be an enum? Or we are considering
>> adding more parametrized adjusters in the future? Aren't we?
>>
>> Now all interfaces and their corresponding utilities are TemporalXYZ,
>> maybe it is worth considering just to drop the "Temporal"? I know
>> I may ask too much:-)
>>
>> The rest looks fine.
>>
>> -Sherman
>>
>>
>> On 10/02/2013 09:01 AM, roger riggs wrote:
>>>
>>> As noted in the issue[1], the static methods in the TemporalAdjuster and
>>> TemporalQuery
>>> interfaces that provide implementations of Adjusters and Queries seem out
>>> of
>>> place and are better located in a related supporting class so the purpose
>>> and
>>> function of the interfaces are not diluted.  Adding more methods in the
>>> future
>>> will be a better fit in the class.
>>>
>>> The static methods of TemporalAdjuster are moved to TemporalAdjusters
>>> and the static method of TemporalQuery are moved to TemporalQueries.
>>> Those classes were previously package private and are now public.
>>>
>>> Please review and comment:
>>>
>>> javadoc:
>>> http://cr.openjdk.java.net/~rriggs/javadoc-temporal-statics-8025722/
>>>
>>> webrev:
>>> http://cr.openjdk.java.net/~rriggs/webrev-temporal-statics-8025722/
>>>
>>> Thanks, Roger
>>>
>>> [1] https://bugs.openjdk.java.net/browse/JDK-8025722
>>>
>>>
>>
>



More information about the core-libs-dev mailing list