openrewrite / openrewrite/rewrite-apache
Apache collections: migrate from `cardinality(O obj, Iterable<? super O> coll)` to `IterableUtils.frequency(Iterable, Object)`
Open
Beginner friendly
Nobody has claimed this yet.
recipe
- Dominant language
- Java
- Stars
- 6
- Forks
- 19
- Avg merge
- 56m
- Merged PRs (30d)
- 3
Description
cardinality(O obj, Iterable<? super O> coll)
Deprecated. since 4.1, use IterableUtils.frequency(Iterable, Object) instead. Be aware that the order of parameters has changed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the Java recipes in this repository for calls to CollectionUtils.cardinality, then inspect the surrounding recipe tests. Replace the deprecated call with IterableUtils.frequency(Iterable, Object), accounting for the reversed parameter order, and run the relevant tests to confirm the migration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100