[ 
http://jira.codehaus.org/browse/MTAGLIST-23?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_105566
 ] 

Michael Johns commented on MTAGLIST-23:
---------------------------------------

That one, and one a few lines earlier:

{code}
String currentLine = reader.readLine().trim();
{code}

Granted, it's highly unlikely (if not impossible) that this line would ever 
fail since the file would have to be empty, but it's still bad practice to 
invoke a method on an object one line before checking if it's null.

> Class name retrieval is not null safe
> -------------------------------------
>
>                 Key: MTAGLIST-23
>                 URL: http://jira.codehaus.org/browse/MTAGLIST-23
>             Project: Maven 2.x Taglist Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Michael Johns
>            Priority: Minor
>
> If a class ends in a closing brace rather than a newline, the 
> FileReport.getClass() name method throws a NullPointerException.  This code 
> is not null safe:
>  reader.readLine().trim();
> If reader.readLine() returns null, the this will fail.  The trim() should be 
> done only after the result is determined to be non-null.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to