Nullable inspection is broken

return of getMilestone is marled as @Nullable

Milestone m = d.getMilestone(MT_LAW_GROUP_ASSIGNMENT_OID);

but

m.setActualDate(r.ATTY_ASSIGN_DT_CURRENT);

is not marked as NPE potential


3 comments

On 2007-04-03 06:07:37 +0400, "Alex Roytman" <nospam@domain.com> said:

return of getMilestone is marled as @Nullable

Milestone m = d.getMilestone(MT_LAW_GROUP_ASSIGNMENT_OID);

but

m.setActualDate(r.ATTY_ASSIGN_DT_CURRENT);

is not marked as NPE potential


Would you please post a full code (or, preferrably a snippet), where
the problem can be reproduce. Details really do matter in this case.
BTW, what build this can be seen in?

Max

0

First of all a different case of invalid error reporting. The code is
autogenerated so it's a bit ugly.

if (new_Docket != null) {
docketId = new_Docket.getId();
}

(new_Docket != null) is marked as redundant always null condition. Which I
do not belive is correct

private void setDocket(Docket newDocket) {
final DocketImpl new_Docket = (DocketImpl)newDocket;
if (docket != null) {
docket.getMilestonesCollection().remove(this);
}
docket = new_Docket;
if (new_Docket != null) {
docketId = new_Docket.getId();
}
if (new_Docket != null) {
new_Docket.getMilestonesCollection().add(this);
}
}

I will try to extract other issue and post it here

"Maxim Shafirov" <max@jetbrains.com> wrote in message
news:eut616$spo$1@is.intellij.net...

On 2007-04-03 06:07:37 +0400, "Alex Roytman" <nospam@domain.com> said:

>
>> return of getMilestone is marled as @Nullable
>>
>> Milestone m = d.getMilestone(MT_LAW_GROUP_ASSIGNMENT_OID);
>>
>> but
>>
>> m.setActualDate(r.ATTY_ASSIGN_DT_CURRENT);
>>
>> is not marked as NPE potential
>

Would you please post a full code (or, preferrably a snippet), where the
problem can be reproduce. Details really do matter in this case.
BTW, what build this can be seen in?

>

Max



0

There's a chance that this happens because the method containing the code is
considered too complex for the Constant Conditions analysis:
http://www.jetbrains.net/jira/browse/IDEADEV-14126

Sascha

0

Please sign in to leave a comment.