Prefer java.nio.charset.StandardCharsets

MSAL

Prefer the Java standard library's java.nio.charset.StandardCharsets over org.apache.commons.lang3.CharEncoding.

org.openrewrite.apache.commons.lang3.UseStandardCharsets
mod run . --recipe=org.openrewrite.apache.commons.lang3.UseStandardCharsets

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. Change static field access to static method access CharEncoding#ISO_8859_1 to name
  2. Change static field access to static method access CharEncoding#US_ASCII to name
  3. Change static field access to static method access CharEncoding#UTF_16 to name
  4. Change static field access to static method access CharEncoding#UTF_16BE to name
  5. Change static field access to static method access CharEncoding#UTF_16LE to name
  6. Change static field access to static method access CharEncoding#UTF_8 to name