Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Dec 25, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…collections (#16776)

* [refactor] replace `Arrays.asList` by `List.of`

`List.of` is preferred because it
1. Optimized, and
2. Returns a truly immutable object.

While `Arrays.asList` returns a list that allows modifications, e.g. using method `*.set(index, value)`.

* [refactor] replace `ImmutableMap.of` by `Map.of`

Guava's method `ImmutableMap.of` was needed until in Java 8 edge, when Java didn't have its own constructor for Maps. Nowadays `Map.of` is the proper way to create maps.

* [refactor] replace `ImmutableList.of` by `List.of`

Guava's method `ImmutableList.of` was needed until in Java 8 edge, when Java didn't have its own constructor for Lists. Nowadays `List.of` is the proper way to create immutable lists.

* [refactor] replace `ImmutableSet.of` by `Set.of`

Guava's method `ImmutableSet.of` was needed until in Java 8 edge, when Java didn't have its own constructor for Sets. Nowadays `Set.of` is the proper way to create immutable Sets.

Sometimes we still need to use `ImmutableSet` - where we need to keep the order of elements.

* use single imports instead of `import x.y.*`
@pull pull bot locked and limited conversation to collaborators Dec 25, 2025
@pull pull bot added the ⤵️ pull label Dec 25, 2025
@pull pull bot merged commit e3d673a into NDViet:trunk Dec 25, 2025
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant