On Wed, 22 Mar 2023 19:12:34 GMT, Andrey Turbanov <[email protected]> wrote:

> Method `'java.awt.MenuBar#shortcuts` creates a 'Vector<MenuShortcut>', fills 
> it and then returns its 'Enumeration elements()' as return value.
> Instead of usage of legacy synchronized Vector here we can use ArrayList 
> instead. Wrap it in Collections.enumeration to adapt to 'Enumeration' result 
> type.

src/java.desktop/share/classes/java/awt/Menu.java line 491:

> 489:     }
> 490: 
> 491:     synchronized Enumeration<MenuShortcut> shortcuts() {

Can we change return type to `List<MenuShortcut>` ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13149#discussion_r1147183464

Reply via email to