mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
ExpressionUtils#isEvaluatedAtCompileTime: fixed for casts to String (operand was not checked)
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// "Use 'fill' method without lambda" "false"
|
||||
import java.util.Arrays;
|
||||
|
||||
class Test {
|
||||
public void test(String[] arr, Object[] arr2) {
|
||||
Arrays.setAll(String, x <caret>-> (String)(arr2[x]));
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -185,7 +185,8 @@ public class ExpressionUtils {
|
||||
return false;
|
||||
}
|
||||
final PsiType type = castType.getType();
|
||||
return TypeUtils.typeEquals(CommonClassNames.JAVA_LANG_STRING, type);
|
||||
return TypeUtils.typeEquals(CommonClassNames.JAVA_LANG_STRING, type) &&
|
||||
isEvaluatedAtCompileTime(typeCastExpression.getOperand());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user