Prefer the Java standard library instead of Apache Commons

MSAL

Prefer the Java standard library instead of Apache Commons. These recipes replace various Apache Commons utilities with their JDK equivalents, where available in Java 11+.

org.openrewrite.apache.commons.PreferJavaStandardLibrary
mod run . --recipe=org.openrewrite.apache.commons.PreferJavaStandardLibrary

Install 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.

  1. Prefer java.util.Base64
  2. ApacheCommonsFileUtils Refaster recipes
  3. Prefer java.nio.file.Files
  4. Prefer java.nio.charset.StandardCharsets
  5. Prefer System.lineSeparator()
  6. ApacheCommonsStringUtils Refaster recipes
  7. Replace StringUtils#defaultIfBlank(String, String) with JDK equivalent
  8. Replace any StringUtils#isBlank(String) and #isNotBlank(String)
  9. Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)
  10. Prefer java.nio.charset.StandardCharsets