RFR: 8307960: Create Table Column PopupMenu lazily

Marius Hanl mhanl at openjdk.org
Fri May 12 20:31:51 UTC 2023


On Fri, 12 May 2023 17:25:22 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> modules/javafx.controls/src/shims/java/javafx/scene/control/skin/TableHeaderRowShim.java line 38:
>> 
>>> 36: 
>>> 37:     public static ContextMenu getColumnPopupMenu(TableHeaderRow tableHeaderRow) {
>>> 38:         return tableHeaderRow.getColumnPopupMenu();
>> 
>> Minor: I would keep `tr` instead of `tableHeaderRow` for consistency with already existing static method.
>
> I would too - avoids wrapping the line, and there is no need to spell the name for a one line method.

I am more a fan of descriptive variable names. I know this is a one-line method - but on the other hand `tr` is just not a good understandable name, even for a very short method.
Since you read code more often than you write it, I'm for keeping the descriptive name, also in this simple case :)

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1133#discussion_r1192768054


More information about the openjfx-dev mailing list