Find filter { it != null }.map { it!! } chains
Proprietaryfilter { it != null }.map { it!! } is the long form of mapNotNull { it }. Both passes can be folded into a single filterNotNull (when no transform is needed) or mapNotNull (with a transform).
org. openrewrite. kotlin. idiom. FindFilterMapToMapNotNull$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. idiom. FindFilterMapToMapNotNull$KtRecipe'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.