mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[jvm-inspections] IDEA-310343 Patterns as arguments for logging
GitOrigin-RevId: 904ee15422954df774ea8514ee86a453a8e53ded
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0aa8fb366c
commit
22e67cafdd
@@ -34,13 +34,13 @@ private class LoggingStringTemplateAsArgumentVisitor(
|
||||
if (valueArguments.isEmpty()) return true
|
||||
var stringExpression = valueArguments[0]
|
||||
var indexStringExpression = 0
|
||||
if (!canBePattern(stringExpression.getExpressionType())) {
|
||||
if (!canBeText(stringExpression.getExpressionType())) {
|
||||
if (valueArguments.size < 2) {
|
||||
return true
|
||||
}
|
||||
stringExpression = valueArguments[1]
|
||||
indexStringExpression = 1
|
||||
if (!canBePattern(stringExpression.getExpressionType())) {
|
||||
if (!canBeText(stringExpression.getExpressionType())) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ private class LoggingStringTemplateAsArgumentVisitor(
|
||||
!stringExpression.operands.all { it is ULiteralExpression }
|
||||
}
|
||||
|
||||
private fun canBePattern(expressionType: PsiType?): Boolean {
|
||||
private fun canBeText(expressionType: PsiType?): Boolean {
|
||||
if (
|
||||
expressionType?.equalsToText(CommonClassNames.JAVA_LANG_STRING) == true ||
|
||||
expressionType?.equalsToText(CommonClassNames.JAVA_LANG_CHAR_SEQUENCE) == true
|
||||
|
||||
Reference in New Issue
Block a user