mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
disable wrap with Integer.parseInt for null type (IDEA-164942)
This commit is contained in:
@@ -148,12 +148,12 @@ public class WrapExpressionFix implements IntentionAction {
|
||||
for (int j = 0; j < expressions.length; j++) {
|
||||
PsiExpression expression = expressions[j];
|
||||
final PsiType exprType = expression.getType();
|
||||
if (exprType != null) {
|
||||
if (exprType != null && !PsiType.NULL.equals(exprType)) {
|
||||
PsiType paramType = parameters[Math.min(j, parameters.length - 1)].getType();
|
||||
if (paramType instanceof PsiEllipsisType) {
|
||||
paramType = ((PsiEllipsisType)paramType).getComponentType();
|
||||
}
|
||||
paramType = substitutor != null ? substitutor.substitute(paramType) : paramType;
|
||||
paramType = substitutor.substitute(paramType);
|
||||
if (paramType.isAssignableFrom(exprType)) continue;
|
||||
final PsiClassType classType = getClassType(paramType, expression);
|
||||
if (expectedType == null && classType != null && findWrapper(exprType, classType, paramType instanceof PsiPrimitiveType) != null) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Wrap using 'Integer.parseInt()'" "false"
|
||||
public class Test {
|
||||
void ba() {
|
||||
fa(<caret>null);
|
||||
}
|
||||
|
||||
void fa(int... i){}
|
||||
}
|
||||
Reference in New Issue
Block a user