mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-177499 ClassCastException in data flow inspection
This commit is contained in:
+1
-1
@@ -136,7 +136,7 @@ public class DfaExpressionFactory {
|
||||
}
|
||||
|
||||
if (DfaValueFactory.isEffectivelyUnqualified(refExpr) || isStaticFinalConstantWithoutInitializationHacks(var)) {
|
||||
if (isFieldDereferenceBeforeInitialization(refExpr)) {
|
||||
if (isFieldDereferenceBeforeInitialization(refExpr) && !(refExpr.getType() instanceof PsiPrimitiveType)) {
|
||||
return myFactory.getConstFactory().getNull();
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -4,4 +4,13 @@ class IgnoreNullabilityOnPrimitiveCast {
|
||||
private static int map(@Nullable int[] mapping, int idx) {
|
||||
return <warning descr="Array access 'mapping[idx]' may produce 'java.lang.NullPointerException'">mapping[idx]</warning>;
|
||||
}
|
||||
|
||||
static final int TEST;
|
||||
|
||||
static {
|
||||
TEST = 4;
|
||||
}
|
||||
|
||||
final int[] arr = {TEST};
|
||||
final int val = TEST;
|
||||
}
|
||||
Reference in New Issue
Block a user