commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <mll...@mvdb.net>
Subject Re: svn commit: r545184 - /jakarta/commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/PoissonDistributionImpl.java
Date Thu, 07 Jun 2007 21:17:49 GMT
If the intention is to have a NullPointerException when null is passed, declare it and throw
it
specifically (that way you are in control of the exception). I think every undocumented nullpointer
exception is a bug.

Mvgr,
Martin

Luc Maisonobe wrote:
> brentworden@apache.org wrote:
> 
>> +    /**
>> +     * Modify the normal distribution used to compute normal approximations.
>> +     * The caller is responsible for insuring the normal distribution has the
>> +     * proper parameter settings.
>> +     * @param value the new distribution
>> +     * @since 1.2
>> +     */
>> +    public void setNormal(NormalDistribution value) {
>> +        normal = value;
>>      }
> 
> Should we check for null parameters here and throw a NPE ourselves or
> simply allow null parameters and let the JVM throw the NPE when the
> distribution is used ?
> 
> I am fine with the current choice of letting the JVM handle this by
> itself, I only wondered what others think about this.
> 
> Luc
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 

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


Mime
View raw message