[OpenJDK 2D-Dev] RFR: 8271603: Unnecessary Vector usage in java.desktop

Сергей Цыпанов github.com+10835776+stsypanov at openjdk.java.net
Mon Aug 9 07:21:49 UTC 2021


On Mon, 5 Jul 2021 19:03:49 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

>> src/java.desktop/share/classes/java/awt/Menu.java line 489:
>> 
>>> 487:     }
>>> 488: 
>>> 489:     synchronized Enumeration<MenuShortcut> shortcuts() {
>> 
>> I'm not sure whether it's ok to change return type here, probably it'd be better to keep `Enumeration` and use `return Collections.enumeration(shortcuts);` in the last line
>
> It's not a public API. As I see from other PR/commits changing package-private methods shouldn't be a problem.

Even non-public method can be called via reflection, so I'd be cautios about changing return type

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

PR: https://git.openjdk.java.net/jdk/pull/4680


More information about the 2d-dev mailing list