commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r615555 - /commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java
Date Sun, 27 Jan 2008 14:51:55 GMT
On 27/01/2008, Phil Steitz <phil.steitz@gmail.com> wrote:
> On Jan 27, 2008 7:25 AM, sebb <sebbaz@gmail.com> wrote:
> >
> > On 27/01/2008, psteitz@apache.org <psteitz@apache.org> wrote:
> > > Author: psteitz
> > > Date: Sat Jan 26 20:22:10 2008
> > > New Revision: 615555
> > >
> > > URL: http://svn.apache.org/viewvc?rev=615555&view=rev
> > > Log:
> > > Removed JDK 1.5-dependent code.
> > > JIRA: MATH-173
> > >
> > > Modified:
> > >     commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java
> > >
> > > Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java
> > > URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java?rev=615555&r1=615554&r2=615555&view=diff
> > > ==============================================================================
> > > --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java
(original)
> > > +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java
Sat Jan 26 20:22:10 2008
> > > @@ -132,9 +132,9 @@
> > >              double[] array;
> > >              try {
> > >                  array = (double[])iterator.next();
> > > -            } catch (Exception ex) {
> > > +            } catch (ClassCastException ex) {
> > >                  throw new IllegalArgumentException(
> > > -                        "ANOVA: categoryData contains non-double[] elements.",
ex);
> > > +                        "ANOVA: categoryData contains non-double[] elements.");
> >
> > Perhaps consider including the exception message in the string, e.g.
> >
> > "ANOVA: categoryData contains non-double[] elements."+ex.toString()
> >
> > or ex.getMessage() ?
>
> Thanks for reviewing this, Sebb.
>
> The previous code was catching "Exception" when in fact the only
> exception that we want to catch at that point is ClassCastException,
> which is what I changed it to and the displayed message then says it
> all.

Duh!

Sorry, that's obvious now I look at the code again.

> Phil
> >
> > >              }
> > >              if (array.length <= 1) {
> > >                  throw new IllegalArgumentException(
> > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

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


Mime
View raw message