mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
null argument checker: accept ephemeral memory states to analysis IDEA-162184
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
class NullLiteralAndInferredMethodContract {
|
||||
{
|
||||
initExpressionConstraints(<warning descr="Passing 'null' argument to non annotated parameter">null</warning>);
|
||||
}
|
||||
|
||||
public void initExpressionConstraints(Object parent) {
|
||||
String currentProperties = getCurrentProperties(parent);
|
||||
System.out.println(currentProperties != null ? currentProperties : "");
|
||||
}
|
||||
|
||||
private String getCurrentProperties(Object parent) {
|
||||
if (parent instanceof String) {
|
||||
return ((String) parent).substring(1);
|
||||
}
|
||||
return <warning descr="'null' is returned by the method which is not declared as @Nullable">null</warning>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user