You are quite right Carlos. As the matter of fact at this stage of code
inspection development idea does not take into an account what particular
method could return. Instead it solely uses single method code. Another
situation of "x == null" may be implicitly produced by a "new" expression.
----- Original Message -----
From: "Carlos Costa e Silva" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 20, 2002 2:59 AM
Subject: RE: Re: [Eap-list] #612 - Inspect "x == null is false" bug
>
> After reflecting on the messages shown by the Inspector, I reviewed my
> (mis)understanding of what it does.
>
> > > JComponent component = getComponent();
> > > final String componentName = component.getName();
> > > if (component == null || !"xxx".equals(componentName)) {
> > > return;
> > > }
>
> As I know that getComponent() can return null, saying component == null
> is always false made me expect that there should be a warning that the
> previous line could throw a NPE.
>
>
> I'm so used to Idea being that smart that obviously it should know when
> methods can return null :)
>
> Now that I'm used to what Inspector really does, the message "x == null
> is always false" makes sense: a NPE can happen somewhere in the code
> before the statement.
>
> Carlos
>
> --
> Carlos Costa e Silva <[EMAIL PROTECTED]>
>
>
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list