mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add cast: don't unbox for null types (IDEA-193174)
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ public abstract class ArgumentFixerActionFactory {
|
||||
if (parameterType instanceof PsiWildcardType) continue;
|
||||
if (!GenericsUtil.isFromExternalTypeLanguage(parameterType)) continue;
|
||||
if (suggestedCasts.contains(parameterType.getCanonicalText())) continue;
|
||||
if (exprType instanceof PsiPrimitiveType && parameterType instanceof PsiClassType) {
|
||||
if (TypeConversionUtil.isPrimitiveAndNotNull(exprType) && parameterType instanceof PsiClassType) {
|
||||
PsiType unboxedParameterType = PsiPrimitiveType.getUnboxedType(parameterType);
|
||||
if (unboxedParameterType != null) {
|
||||
parameterType = unboxedParameterType;
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Cast parameter to 'java.lang.Integer'" "true"
|
||||
class a {
|
||||
void m(Integer i){}
|
||||
void m(String s) {}
|
||||
void f() {
|
||||
m((Integer) null);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Cast parameter to 'java.lang.Integer'" "true"
|
||||
class a {
|
||||
void m(Integer i){}
|
||||
void m(String s) {}
|
||||
void f() {
|
||||
m(<caret>null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user