tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Menard (JIRA)" <...@tapestry.apache.org>
Subject [jira] Commented: (TAPESTRY-2253) Required Validator can produce NullPointerExceptions
Date Wed, 12 Mar 2008 20:34:46 GMT

    [ https://issues.apache.org/jira/browse/TAPESTRY-2253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578013#action_12578013
] 

Kevin Menard commented on TAPESTRY-2253:
----------------------------------------

I'd make the change to help users that shoot themselves in the foot, but under no circumstance
should null be returned from toString().  It violates the general contract of the method.

> Required Validator can produce NullPointerExceptions
> ----------------------------------------------------
>
>                 Key: TAPESTRY-2253
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2253
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.12
>            Reporter: Kristian Marinkovic
>
> the validate method of the Required validator contains following code line:
> if (value == null || value.toString().equals(""))...
> if the toString method returns null an exception will occur (happened to me accidentally
:)) 
> this code line should at least be changed to:
> if (value == null || "".equals(value.toString())... to prevent NPE

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message