mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-87652
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Npe.java</file>
|
||||
<line>6</line>
|
||||
<description>Method invocation <code>((SomeInterfaceImpl)x).bar()</code> may produce <code>java.lang.NullPointerException</code></description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class Npe {
|
||||
|
||||
void foo(@Nullable SomeInterface x) {
|
||||
((SomeInterfaceImpl)x).bar();
|
||||
}
|
||||
|
||||
interface SomeInterface {
|
||||
void bar();
|
||||
}
|
||||
|
||||
class SomeInterfaceImpl implements SomeInterface {
|
||||
@Override
|
||||
public void bar() {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user