J2K: Do not convert string literal with escaped symbols automaticaly during java to kotlin conversion

#KT-9942 Fixed
This commit is contained in:
Natalia Ukhorskaya
2015-11-11 18:39:00 +03:00
parent 68101eeffa
commit a983e6cf60
2 changed files with 3 additions and 10 deletions
@@ -52,7 +52,9 @@ public class ConvertToStringTemplateIntention : SelfTargetingOffsetIndependentIn
public fun shouldSuggestToConvert(expression: KtBinaryExpression): Boolean {
val entries = buildReplacement(expression).entries
return entries.none { it is KtBlockStringTemplateEntry } && entries.count { it is KtLiteralStringTemplateEntry } > 1
return entries.none { it is KtBlockStringTemplateEntry } &&
!entries.all { it is KtLiteralStringTemplateEntry || it is KtEscapeStringTemplateEntry }
&& entries.count { it is KtLiteralStringTemplateEntry } > 1
}
private fun isApplicableToNoParentCheck(expression: KtBinaryExpression): Boolean {
@@ -7,13 +7,4 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Convert string concatenation to string template</problem_class>
<description>Convert concatenation to template</description>
</problem>
<problem>
<file>backslashNMultilineString.kt</file>
<line>2</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="backslashNMultilineString.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Convert string concatenation to string template</problem_class>
<description>Convert concatenation to template</description>
</problem>
</problems>