On Wed, 14 May 2025 17:42:33 GMT, Stuart Marks <sma...@openjdk.org> wrote:

>>> so that all concrete implementations in this class call only the abstract 
>>> three-arg read() method
>> 
>> Done in 3cbaede and also `str` -> `cbuf`.
>
> The code should use the three-arg read() call in order to limit self-calls, 
> in order to avoid the fragile base class problem. At some point we might want 
> to add implSpec tags to specify this. See my previous comments relate to this 
> topic: 
> 
> https://github.com/openjdk/jdk/pull/24728#issuecomment-2848332415

I know that comment already, but IMHO we can simply use `@implSpec` to 
unambiguously make clear that this method invokes `read(char[])` to allow 
optimized implementations, and it *might* in turn invoke 
`read(char[],int,int)`, but this is *not guaranteed*. A class is only fragile 
as long as we do not *document* what it will do.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24728#discussion_r2089456975

Reply via email to