Closed kunli2 closed 11 months ago
There are total 3 usage scenarios of IsNullSafe marker.
IsNullSafe
J.FieldAccess, example: test ?. property, the space before ?. is handled by leftPadded
J.FieldAccess
test ?. property
?.
J.MethodInvocation, example:
J.MethodInvocation
val filter = null ?. let { _ -> { false } }
the space before ?. is handled by suffix of the select (RightPadded)
J.TypeCast, example val map = mapOf(Pair("one", 1)) as? Map<*, *>, the space before ?. is handled by the prefix of J.TypeCast.clazz
J.TypeCast
val map = mapOf(Pair("one", 1)) as? Map<*, *>
J.TypeCast.clazz
so the prefix in this marker is not necessary, we can just deprecate the prefix field and keep the marker there.
prefix
this PR is related to https://github.com/openrewrite/rewrite-kotlin/issues/477
There are total 3 usage scenarios of
IsNullSafe
marker.J.FieldAccess
, example:test ?. property
, the space before?.
is handled by leftPaddedJ.MethodInvocation
, example:the space before
?.
is handled by suffix of the select (RightPadded)J.TypeCast
, exampleval map = mapOf(Pair("one", 1)) as? Map<*, *>
, the space before?.
is handled by the prefix ofJ.TypeCast.clazz
so the prefix in this marker is not necessary, we can just deprecate the
prefix
field and keep the marker there.this PR is related to https://github.com/openrewrite/rewrite-kotlin/issues/477