Recipes to replace Guava `Immutable{Set|List|Map}.copyOf()` with Java `{Set|List|Map}.copyOf()`
- Fixes #584
Add recipes to replace Guava ImmutableSet.copyOf(), ImmutableList.copyOf(), and ImmutableMap.copyOf() calls with Java Set.copyOf(), List.copyOf(), and Map.copyOf() calls.
- Add
AbstractNoGuavaImmutableCopyOfclass to provide a base for the new recipes. - Add
NoGuavaImmutableSetCopyOf,NoGuavaImmutableListCopyOf, andNoGuavaImmutableMapCopyOfclasses extendingAbstractNoGuavaImmutableCopyOf. - Update
no-guava.ymlto include the new recipes. - Add test classes
NoGuavaImmutableSetCopyOfTest,NoGuavaImmutableListCopyOfTest, andNoGuavaImmutableMapCopyOfTestwith test cases for the new recipes.
For more details, open the Copilot Workspace session.
In my opinion, a new abstract class known as AbstractNoGuavaImmutable can be created and the common methods can be added to it. We can further expand it with AbstractNoGuavaImmutableCopyOf.java and AbstractNoGuavaImmutableOf.java to eliminate the use of duplicated code.
I was thinking along the same lines, especially after the improvements you added @BramliAK ; reuse between these two is likely preferred over duplication.
This PR is stale because it has been open for 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.