On Mon, 24 Feb 2025 21:29:02 GMT, Anthony Scarpino <ascarp...@openjdk.org> wrote:
>> On the 2nd thought: `Set.of` was introduced in 2015, so it's not available >> in Java 8, this might be a problem when backporting this code. >> @seanjmullan what are your thoughts about this? > > Something like this is probably ok given it's only jdk8. When many release > don't have support, I think it's more of a concern. Additionally these are > variable definitions, that are unlikely to change while if a deviation > happened in a method, it can get more complex over time. Don't be overly concerned when contemplating whether to use new APIs or language features in the implementation. (The public API is a different issue). If it makes the code faster or easier to read/maintain, then it's fine to use it. When backporting, the code can be adjusted to use different APIs, etc. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23681#discussion_r1970564318