mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-122974 expected type suggester should ignore 'null' types
This commit is contained in:
@@ -495,7 +495,7 @@ public class ExpectedTypesProvider {
|
||||
PsiExpression rExpr = assignment.getRExpression();
|
||||
if (rExpr != null) {
|
||||
PsiType type = rExpr.getType();
|
||||
if (type != null) {
|
||||
if (type != null && type != PsiType.NULL) {
|
||||
if (type instanceof PsiClassType) {
|
||||
final PsiClass resolved = ((PsiClassType)type).resolve();
|
||||
if (resolved instanceof PsiAnonymousClass) {
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create Local Variable 'str'" "true"
|
||||
public class A {
|
||||
void foo() {
|
||||
String str;
|
||||
String s = str;
|
||||
str = null;
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Create Local Variable 'str'" "true"
|
||||
public class A {
|
||||
void foo() {
|
||||
String s = s<caret>tr;
|
||||
str = null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user