RFR: 8302173: Button border overlaps with button icon on macOS system LaF [v3]
Harshitha Onkar
honkar at openjdk.org
Wed Feb 22 00:15:32 UTC 2023
On Tue, 21 Feb 2023 23:10:44 GMT, SWinxy <duke at openjdk.org> wrote:
>> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add instanceof check
>
> src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java line 344:
>
>> 342: final View v = (View)c.getClientProperty(BasicHTML.propertyKey);
>> 343: if (v != null && c instanceof AbstractButton
>> 344: && ((AbstractButton) c).getIcon() == null) {
>
> We already know for certain that `c` is an AbstractButton. The first thing in the paint call, the component is casted. Why cast again when we can reuse the variable:
> Suggestion:
>
> if (v != null && b.getIcon() == null) {
>
>
> (also on ln 309 we could do the same thing)
@SWinxy Looks cleaner. Thanks for the suggestion.
-------------
PR: https://git.openjdk.org/jdk/pull/12520
More information about the client-libs-dev
mailing list