On Mon, 18 May 2026 08:38:52 GMT, Per Minborg <[email protected]> wrote:

>> 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.

This is standard set, the platform specific subclass will combine this with the 
platform specific views, and caches it. It's okay to change this one to use 
List.of but it might be better to just the changes to the subclasses as that it 
is Set that is exposed by the API and where behavioral differences can be 
observed. If that part is included then it will need a CSR to discuss/track the 
compatibility impact.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31135#discussion_r3257671131

Reply via email to