Apache Commons best practices
MSALApply best practices to code that uses Apache Commons libraries: migrate off the end-of-life Commons Lang 2.x, Commons Collections 3.x and Commons Math 2.x major versions, correct the commons-io coordinates, replace deprecated APIs with their supported replacements, make character encodings explicit, and prefer the Java standard library where it now offers an equivalent.
org. openrewrite. apache. commons. ApacheCommonsBestPracticesmod run . --recipe= org. openrewrite. apache. commons. ApacheCommonsBestPracticesInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Migrates to Apache Commons Collections 4.x
- Replace
CollectionUtils.cardinalitywithIterableUtils.frequency - Migrates to Apache Commons Lang 3.x
- Migrates to Apache Commons Math 3.x
- Relocate
org.apache.commons:commons-iotocommons-io:commons-io - Use IOUtils method that include their charset encoding
- Migrate deprecated SystemUtils constants
- Prefer the Java standard library instead of Apache Commons