ConversionResult (@NotNull PsiType lType, @NotNull PsiType rType, @NotNull Position position, @NotNull GroovyPsiElement context) { if (!isClassType(lType, JAVA_LANG_STRING)) return null; if (position == Position.EXPLICIT_CAST || position == Position.METHOD_PARAMETER) { return isClassType(rType, GROOVY_LANG_GSTRING) ? ConversionResult.OK : null; } return ConversionResult.OK; }