fixed a serialization-related array update error in DummyStepInterpolator

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@582682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2007-10-07 21:19:14 +00:00
parent 67b86d4ccf
commit 00f7b063b3
2 changed files with 6 additions and 22 deletions

View File

@ -17,6 +17,8 @@
package org.apache.commons.math.ode;
import java.io.Serializable;
/**
* This class is a step handler that do nothing.
@ -36,7 +38,7 @@ package org.apache.commons.math.ode;
*/
public class DummyStepHandler
implements StepHandler {
implements StepHandler, Serializable {
/** Private constructor.
* The constructor is private to prevent users from creating
@ -88,4 +90,6 @@ public class DummyStepHandler
/** The only instance. */
private static DummyStepHandler instance = null;
private static final long serialVersionUID = 2731635121223090252L;
}

View File

@ -61,27 +61,6 @@ public class DummyStepInterpolator
super(y, forward);
}
/** Copy constructor.
* <p>The copied interpolator should have been finalized before the
* copy, otherwise the copy will not be able to perform correctly
* any interpolation and will throw a {@link NullPointerException}
* later. Since we don't want this constructor to throw the
* exceptions finalization may involve and since we don't want this
* method to modify the state of the copied interpolator,
* finalization is <strong>not</strong> done automatically, it
* remains under user control.</p>
* <p>The copy is a deep copy: its arrays are separated from the
* original arrays of the instance.</p>
* @param interpolator interpolator to copy from.
*/
protected DummyStepInterpolator(DummyStepInterpolator interpolator) {
super(interpolator);
}
/** Compute the state at the interpolated time.
* In this class, this method does nothing: the interpolated state
* is always the state at the end of the current step.
@ -94,6 +73,7 @@ public class DummyStepInterpolator
*/
protected void computeInterpolatedState(double theta, double oneMinusThetaH)
throws DerivativeException {
System.arraycopy(currentState, 0, interpolatedState, 0, currentState.length);
}
public void writeExternal(ObjectOutput out)