You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Dennis Hendriks <D....@tue.nl> on 2011/09/05 08:34:54 UTC

Re: svn commit: r1165033 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java

Hi Luc,

question: is there a reason you applied this to StepHandler, but not 
FixedStepHandler?

Best regards,
Dennis



luc@apache.org wrote:
> Author: luc
> Date: Sun Sep  4 14:36:48 2011
> New Revision: 1165033
> 
> URL: http://svn.apache.org/viewvc?rev=1165033&view=rev
> Log:
> removed MathUserException from StepHandler interface
> 
> JIRA: MATH-488
> 
> Modified:
>     commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> 
> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java?rev=1165033&r1=1165032&r2=1165033&view=diff
> ==============================================================================
> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java (original)
> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java Sun Sep  4 14:36:48 2011
> @@ -17,7 +17,6 @@
>  
>  package org.apache.commons.math.ode.sampling;
>  
> -import org.apache.commons.math.exception.MathUserException;
>  
>  /**
>   * This interface represents a handler that should be called after
> @@ -60,9 +59,7 @@ public interface StepHandler {
>     * Keeping only a reference to the interpolator and reusing it will
>     * result in unpredictable behavior (potentially crashing the application).
>     * @param isLast true if the step is the last one
> -   * @exception MathUserException if user code called from step interpolator
> -   * finalization triggers one
>     */
> -  void handleStep(StepInterpolator interpolator, boolean isLast) throws MathUserException;
> +  void handleStep(StepInterpolator interpolator, boolean isLast);
>  
>  }
> 
> 


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


Re: svn commit: r1165033 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java

Posted by lu...@free.fr.
Hi Dennis,

----- Mail original -----
> Hi Luc,
> 
> The FirstOrderDifferentialEquations interface has a method
> computeDerivatives, which also still throws the MathUserException.
> Did you
> forget that one as well, or did you intentionally leave it in?


I forgot it. MathUserException should completely disappear from ODE, and maybe fom other packages too
like solvers or optimizers.

In fact, even if it does not disappear completely, I would suggest user to not use it anymore and use
their own unchecked exceptions. Users can define a class that does not throw this exception even if
the interface declaration does specifies it (but the other way round is forbidden: you can't add
a checked exception not declared in the interface).

best regards,
Luc

> 
> Best regards,
> Dennis
> 
> 
> luc.maisonobe@free.fr wrote:
> > Hi Dennis,
> > 
> > ----- Mail original -----
> >> Hi Luc,
> >>
> >> question: is there a reason you applied this to StepHandler, but
> >> not
> >> FixedStepHandler?
> > 
> > No, I simply forgot it. I'll fix that. Thanks for reminding me
> > about it.
> > 
> > The proper way to propagate exception (discussed a while ago), is
> > to have user
> > set up an unchecked exception of his own. This way, he is certain
> > [math] will
> > not catch it.
> > 
> > best regards
> > 
> > Luc
> > 
> >> Best regards,
> >> Dennis
> >>
> >>
> >>
> >> luc@apache.org wrote:
> >>> Author: luc
> >>> Date: Sun Sep  4 14:36:48 2011
> >>> New Revision: 1165033
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1165033&view=rev
> >>> Log:
> >>> removed MathUserException from StepHandler interface
> >>>
> >>> JIRA: MATH-488
> >>>
> >>> Modified:
> >>>     commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> >>>
> >>> Modified:
> >>> commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> >>> URL:
> >>> http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java?rev=1165033&r1=1165032&r2=1165033&view=diff
> >>> ==============================================================================
> >>> ---
> >>> commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> >>> (original)
> >>> +++
> >>> commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> >>> Sun Sep  4 14:36:48 2011
> >>> @@ -17,7 +17,6 @@
> >>>  
> >>>  package org.apache.commons.math.ode.sampling;
> >>>  
> >>> -import org.apache.commons.math.exception.MathUserException;
> >>>  
> >>>  /**
> >>>   * This interface represents a handler that should be called
> >>>   after
> >>> @@ -60,9 +59,7 @@ public interface StepHandler {
> >>>     * Keeping only a reference to the interpolator and reusing it
> >>>     will
> >>>     * result in unpredictable behavior (potentially crashing the
> >>>     application).
> >>>     * @param isLast true if the step is the last one
> >>> -   * @exception MathUserException if user code called from step
> >>> interpolator
> >>> -   * finalization triggers one
> >>>     */
> >>> -  void handleStep(StepInterpolator interpolator, boolean isLast)
> >>> throws MathUserException;
> >>> +  void handleStep(StepInterpolator interpolator, boolean
> >>> isLast);
> >>>  
> >>>  }
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> 
> 

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


Re: svn commit: r1165033 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java

Posted by Dennis Hendriks <D....@tue.nl>.
Hi Luc,

The FirstOrderDifferentialEquations interface has a method 
computeDerivatives, which also still throws the MathUserException. Did you 
forget that one as well, or did you intentionally leave it in?

Best regards,
Dennis


luc.maisonobe@free.fr wrote:
> Hi Dennis,
> 
> ----- Mail original -----
>> Hi Luc,
>>
>> question: is there a reason you applied this to StepHandler, but not
>> FixedStepHandler?
> 
> No, I simply forgot it. I'll fix that. Thanks for reminding me about it.
> 
> The proper way to propagate exception (discussed a while ago), is to have user
> set up an unchecked exception of his own. This way, he is certain [math] will
> not catch it.
> 
> best regards
> 
> Luc
> 
>> Best regards,
>> Dennis
>>
>>
>>
>> luc@apache.org wrote:
>>> Author: luc
>>> Date: Sun Sep  4 14:36:48 2011
>>> New Revision: 1165033
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1165033&view=rev
>>> Log:
>>> removed MathUserException from StepHandler interface
>>>
>>> JIRA: MATH-488
>>>
>>> Modified:
>>>     commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
>>>
>>> Modified:
>>> commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
>>> URL:
>>> http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java?rev=1165033&r1=1165032&r2=1165033&view=diff
>>> ==============================================================================
>>> ---
>>> commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
>>> (original)
>>> +++
>>> commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
>>> Sun Sep  4 14:36:48 2011
>>> @@ -17,7 +17,6 @@
>>>  
>>>  package org.apache.commons.math.ode.sampling;
>>>  
>>> -import org.apache.commons.math.exception.MathUserException;
>>>  
>>>  /**
>>>   * This interface represents a handler that should be called after
>>> @@ -60,9 +59,7 @@ public interface StepHandler {
>>>     * Keeping only a reference to the interpolator and reusing it
>>>     will
>>>     * result in unpredictable behavior (potentially crashing the
>>>     application).
>>>     * @param isLast true if the step is the last one
>>> -   * @exception MathUserException if user code called from step
>>> interpolator
>>> -   * finalization triggers one
>>>     */
>>> -  void handleStep(StepInterpolator interpolator, boolean isLast)
>>> throws MathUserException;
>>> +  void handleStep(StepInterpolator interpolator, boolean isLast);
>>>  
>>>  }
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: svn commit: r1165033 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java

Posted by lu...@free.fr.
Hi Dennis,

----- Mail original -----
> Hi Luc,
> 
> question: is there a reason you applied this to StepHandler, but not
> FixedStepHandler?

No, I simply forgot it. I'll fix that. Thanks for reminding me about it.

The proper way to propagate exception (discussed a while ago), is to have user
set up an unchecked exception of his own. This way, he is certain [math] will
not catch it.

best regards

Luc

> 
> Best regards,
> Dennis
> 
> 
> 
> luc@apache.org wrote:
> > Author: luc
> > Date: Sun Sep  4 14:36:48 2011
> > New Revision: 1165033
> > 
> > URL: http://svn.apache.org/viewvc?rev=1165033&view=rev
> > Log:
> > removed MathUserException from StepHandler interface
> > 
> > JIRA: MATH-488
> > 
> > Modified:
> >     commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> > 
> > Modified:
> > commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> > URL:
> > http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java?rev=1165033&r1=1165032&r2=1165033&view=diff
> > ==============================================================================
> > ---
> > commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> > (original)
> > +++
> > commons/proper/math/trunk/src/main/java/org/apache/commons/math/ode/sampling/StepHandler.java
> > Sun Sep  4 14:36:48 2011
> > @@ -17,7 +17,6 @@
> >  
> >  package org.apache.commons.math.ode.sampling;
> >  
> > -import org.apache.commons.math.exception.MathUserException;
> >  
> >  /**
> >   * This interface represents a handler that should be called after
> > @@ -60,9 +59,7 @@ public interface StepHandler {
> >     * Keeping only a reference to the interpolator and reusing it
> >     will
> >     * result in unpredictable behavior (potentially crashing the
> >     application).
> >     * @param isLast true if the step is the last one
> > -   * @exception MathUserException if user code called from step
> > interpolator
> > -   * finalization triggers one
> >     */
> > -  void handleStep(StepInterpolator interpolator, boolean isLast)
> > throws MathUserException;
> > +  void handleStep(StepInterpolator interpolator, boolean isLast);
> >  
> >  }
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> 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