RFR: 4668290: unclear spec for Polygon.bounds field [v2]

Alexey Ivanov aivanov at openjdk.org
Mon Dec 5 19:17:53 UTC 2022


On Fri, 30 Sep 2022 21:30:25 GMT, SWinxy <duke at openjdk.org> wrote:

>> New documentation replaces the `This value can be null.`:
>> 
>> When created, {@link #invalidate() invalidated}, or {@link #reset() reset},
>> this becomes {@code null}. To get out of the null state,
>> {@link #getBounds()} called with {@link #npoints} being greater than
>> {@code 0} will transfer into a non-null {@link Rectangle}.
>> 
>> 
>> I think I've got the reason for why it can be `null` correct, but you never know.
>> 
>> In javax.swing.text.html.Map, I've replaced setting the field to null with the equivalent #invalidate(). This may mean we can make the field private in the future.
>
> SWinxy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reword change based off of Phil's suggestion
>   
>   Thanks, Phil.

src/java.desktop/share/classes/java/awt/Polygon.java line 108:

> 106:      * <p>
> 107:      * The value of this field is updated by the implementation which
> 108:      * may set it to null and will reevaluate it as needed. Application

I'd use `{@code null}` syntax.

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

PR: https://git.openjdk.org/jdk/pull/10417



More information about the client-libs-dev mailing list