On Fri, 15 May 2026 03:25:33 GMT, Stuart Marks <[email protected]> wrote:
>> This PR proposes to replace older `Collection.unmodifiable` wrappers with >> `Set.of()` instead. This can improve performance, reduce footprint, and >> reduce maintenance. There is also occasional use of `Map.of()` in nearby >> places where `Set.of()` was introduced. >> >> The PR also contains two optimizations in `PlatformMBeanProviderImpl` that >> remove `synchronized` from two methods. >> >> --------- >> - [X] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java line 128: > >> 126: >> 127: static List<String> standardFileAttributeViews() { >> 128: return List.of("basic", "posix", "unix", "owner"); > > In both cases this creates a new array and a new List on every call. Is it > worth stashing this in a static final? I think this method is only called once. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31135#discussion_r3257474285
