On Tue, 4 Oct 2022 19:05:56 GMT, Andy Goryachev <[email protected]> wrote:

>> Maybe something like `will check the return value of {@link 
>> Skin#getSkinnable()}, if the Skin is not {@code null}, against this 
>> Control...`?
>
> How about
> 
> 
>      * To ensure a one-to-one relationship between a {@code Skinnable} and its
>      * {@code Skin}, some implementations of {@link Skinnable#setSkin(Skin)} 
> method will check
>      * the return value of {@link Skin#getSkinnable()}, and if it is not 
> {@code null}, compare it
>      * with this Skinnable, throwing an {@code IllegalArgumentException} if 
> it is not the same.

The problem with this proposed wording (which I see you didn't go with) is that 
it is the skin itself that could be null -- you can't even call 
`getSkinnable()` if the skin is null.

Also, it has the problem Jeanette mentioned -- we don't want to refer to "the 
setSkin method". Instead, you can say something like "when the skin property is 
set" (or just "when the skin is set"). The reason for this is that the skin 
property can also be set by calling `skinProperty().set()`.

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

PR: https://git.openjdk.org/jfx/pull/845

Reply via email to