mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
dfa: analyze inner class field initializers
This commit is contained in:
@@ -220,6 +220,9 @@ public class DataFlowRunner {
|
||||
for (PsiClassInitializer initializer : nestedClass.getInitializers()) {
|
||||
myNestedClosures.putValue(initializer.getBody(), closureState);
|
||||
}
|
||||
for (PsiField field : nestedClass.getFields()) {
|
||||
myNestedClosures.putValue(field, closureState);
|
||||
}
|
||||
}
|
||||
|
||||
protected ControlFlowAnalyzer createControlFlowAnalyzer() {
|
||||
|
||||
+2
-1
@@ -2,13 +2,14 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Zoo2 {
|
||||
|
||||
void foo(@Nullable Object foo) {
|
||||
void foo(@Nullable Object foo, @Nullable Object bar) {
|
||||
if (foo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
new Runnable() {
|
||||
int hc = foo.hashCode();
|
||||
int hc2 = <warning descr="Method invocation 'bar.hashCode()' may produce 'java.lang.NullPointerException'">bar.hashCode()</warning>;
|
||||
|
||||
public void run() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user