On 27/01/2008, Phil Steitz <[EMAIL PROTECTED]> wrote: > On Jan 27, 2008 7:25 AM, sebb <[EMAIL PROTECTED]> wrote: > > > > On 27/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]