@Nullable problems

Hi all,

As shown in the attached screenshots, IntelliJ is giving me incorrect results for the @Nullable annotation in 7.0 M1a - is anyone else seeing this?

Cheers,
Colin



Attachment(s):
Picture 3.png
Picture 2.png
Picture 1.png
0
2 comments
Avatar
Permanently deleted user

The problem is that method calls my have side-effects, to say nothing of
multi-threaded effects, so Idea is very conservative (too conservative
in my book) and decides that the method you have called might reset the
field to null.

You can work around it by introducing a local variable, e.g.
ContractNodes n = this.contractNodes;
if (n != null)
{
n.getInputContractNode().deleteObservers();
n.getOutputContractNode().deleteObservers();
}

and so on.

HTH,
R

0

Great, thanks! That's certainly conservative, but I guess it has to be.

Cheers,
Colin

0

Please sign in to leave a comment.