Prefer new String(Files.readAllBytes(path), charset)
MSALReplace Guava's Files.toString(File, Charset) and Files.asCharSource(File, Charset).read() with new String(java.nio.file.Files.readAllBytes(file.toPath()), charset). Like Guava, it replaces malformed input with the replacement character, where Files.readString(Path, Charset) throws a MalformedInputException.
org. openrewrite. java. migrate. guava. NoGuavaFilesToStringmod run . --recipe= org. openrewrite. java. migrate. guava. NoGuavaFilesToStringInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.