You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Michael Elman (JIRA)" <ji...@apache.org> on 2009/07/05 10:38:14 UTC
[jira] Commented: (WINK-37) detection of null params to avoid NPE
[ https://issues.apache.org/jira/browse/WINK-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727303#action_12727303 ]
Michael Elman commented on WINK-37:
-----------------------------------
Personally I prefer to fail user with NPE.
The reason: user that receives null, thinks that there is no available provider for the submitted input.
But actually this is not the case, since user has passed null for a required parameter and this means there is a bug in his code.
> detection of null params to avoid NPE
> -------------------------------------
>
> Key: WINK-37
> URL: https://issues.apache.org/jira/browse/WINK-37
> Project: Wink
> Issue Type: Improvement
> Components: Common
> Affects Versions: 0.1
> Reporter: Mike Rheinheimer
> Attachments: npe_patch.txt
>
>
> I was working on a few bigger integration tests, and ran into some NPEs in ProvidersRegistry due to my resource passing null params into ProvidersImpl.* methods. Granted, this is something an app or resource should not normally do, but I think some protection against NPE would be good here. Please see proposed patch with tests.
> The supplied test is a start on building up more ProvidersImpl unittests.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.