Replace Stream.collect(Collectors.toUnmodifiableList()) with Stream.toList()
MSALReplace Stream.collect(Collectors.toUnmodifiableList()) with Java 16+ Stream.toList(). Also replaces Stream.collect(Collectors.toList()) if convertToList is set to true.
org. openrewrite. java. migrate. util. ReplaceStreamCollectWithToListOptional
convertToListBoolean
Also replace Stream.collect(Collectors.toList()) with Stream.toList(). BEWARE: Attempts to modify the returned list, result in an UnsupportedOperationException!
mod run . --recipe= org. openrewrite. java. migrate. util. ReplaceStreamCollectWithToListInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.