Inspector is right, but the message is misleading.

What this means is: strLine can't be null because it's used before this 
(strLine.indexOf(...) and an NPE would already have been thrown.

Maybe the inspector message should be changed to something like:

strLine != null is always true because strLine is used before this 
point.

Carlos


> String strLine = lineRdr.readLine();
> int nIndex = strLine.indexOf( "public void test" );
> if ( strLine != null && nIndex != -1 ) {
>     strLastMethod = strLine.substring( nIndex + 12, 
> strLine.indexOf( "(" ) );
> }
> 
> 
> The strLine != null part of the if statement is marked as 
> "always being true"
> in the Constant Conditions tab of inspection.
> 
> -- Rick


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to