You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mrunit.apache.org by "Jim Donofrio (Commented) (JIRA)" <ji...@apache.org> on 2012/03/16 10:53:41 UTC

[jira] [Commented] (MRUNIT-66) null input checks are inconsistent in at least the MapDriver class

    [ https://issues.apache.org/jira/browse/MRUNIT-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231005#comment-13231005 ] 

Jim Donofrio commented on MRUNIT-66:
------------------------------------

http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html

Javadoc seems clear that we should throw a NullPointerException for "Applications should throw instances of this class to indicate other illegal uses of the null object." I think I will add a method to check for null and a throw an exception with the passed in argument name everywhere we take an input from the outside.

I will change the driver classes to all throw IllegalStateException when the user doesnt pass in any input to a driver
                
> null input checks are inconsistent in at least the MapDriver class
> ------------------------------------------------------------------
>
>                 Key: MRUNIT-66
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-66
>             Project: MRUnit
>          Issue Type: Improvement
>    Affects Versions: 0.8.1
>            Reporter: Jim Donofrio
>            Assignee: Jim Donofrio
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> the MapDriver class does not allow null input values if using setInput(Pair) but does allow null input if using setInputKey, setInputValue, or setInput(key, value)
> Also the MapDriver, ReduceDriver classes will throw null pointer exceptions with no input while the MapReduceDriver and Pipeline classes will just log warnings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira