mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
ControlFlowAnalyzer: repeat unboxing for every case label if necessary
Without this it was possible (at least on the incorrect code) that boxed and unboxed classes for the same value get united, which in turn caused repeating entry in DfaMemoryStateImpl#myIdToEqClassesIndices, which could cause NPE when performing successive flush for given variable. Now we throw directly at classes unification attempt to catch illegal state earlier Fixes EA-118152 - IAE: EqClass.$$$reportNull$$$
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
public enum Test {
|
||||
VALUE;
|
||||
|
||||
void test() {
|
||||
Integer code = getCode();
|
||||
switch (code) {
|
||||
case VALUE.value()<EOLError descr="':' expected"></EOLError>
|
||||
}
|
||||
if (code == VALUE.value()) {
|
||||
getCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int value() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
public native Integer getCode();
|
||||
}
|
||||
@@ -96,6 +96,7 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
|
||||
public void testNotEqualsDoesntImplyNotNullity() { doTest(); }
|
||||
public void testEqualsEnumConstant() { doTest(); }
|
||||
public void testSwitchEnumConstant() { doTest(); }
|
||||
public void testIncompleteSwitchEnum() { doTest(); }
|
||||
public void testEnumConstantNotNull() { doTest(); }
|
||||
public void testCheckEnumConstantConstructor() { doTest(); }
|
||||
public void testCompareToEnumConstant() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user