On Mon, 17 May 2021 17:13:58 GMT, Stephen Colebourne <scolebou...@openjdk.org> 
wrote:

>> src/java.base/share/classes/java/time/Clock.java line 128:
>> 
>>> 126:  * Implementations should implement {@code Serializable} wherever 
>>> possible and must
>>> 127:  * document whether or not they do support serialization.
>>> 128:  *
>> 
>> The ImplSpec needs to say how it is implemented.
>> The 'implements InstantSource' can not mandate any particular 
>> implementation. Its just an interface the real behavior comes from its 
>> implementations.  In this case Clock.  Referring to the static methods of 
>> InstantSource behavior may be sufficient because that behavior is concrete.
>
> There are plenty of examples of interfaces in `java.time` and elsewhere that 
> apply restrictions to implementations. Nevertheless, for simplicity and 
> expediency I have reinstated the `implSpec` on `Clock`

ok, thanks.
Assertions in interfaces are toothless. Tests can only be written for 
implementations.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4016

Reply via email to