fixed a serialization error introduced by yesterday changes
(sorry for the noise) git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@789358 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c7beb702d8
commit
879518c341
|
@ -362,7 +362,7 @@ public abstract class AbstractStepInterpolator
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public abstract void readExternal(ObjectInput in)
|
public abstract void readExternal(ObjectInput in)
|
||||||
throws IOException;
|
throws IOException, ClassNotFoundException;
|
||||||
|
|
||||||
/** Save the base state of the instance.
|
/** Save the base state of the instance.
|
||||||
* This method performs step finalization if it has not been done
|
* This method performs step finalization if it has not been done
|
||||||
|
|
|
@ -187,18 +187,64 @@ public class NordsieckStepInterpolator extends AbstractStepInterpolator {
|
||||||
@Override
|
@Override
|
||||||
public void writeExternal(final ObjectOutput out)
|
public void writeExternal(final ObjectOutput out)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
|
// save the state of the base class
|
||||||
writeBaseExternal(out);
|
writeBaseExternal(out);
|
||||||
|
|
||||||
|
// save the local attributes
|
||||||
|
out.writeDouble(scalingH);
|
||||||
|
out.writeDouble(referenceTime);
|
||||||
|
|
||||||
|
final int n = (currentState == null) ? -1 : currentState.length;
|
||||||
|
if (scaled == null) {
|
||||||
|
out.writeBoolean(false);
|
||||||
|
} else {
|
||||||
|
out.writeBoolean(true);
|
||||||
|
for (int j = 0; j < n; ++j) {
|
||||||
|
out.writeDouble(scaled[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nordsieck == null) {
|
||||||
|
out.writeBoolean(false);
|
||||||
|
} else {
|
||||||
|
out.writeBoolean(true);
|
||||||
|
out.writeObject(nordsieck);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public void readExternal(final ObjectInput in)
|
public void readExternal(final ObjectInput in)
|
||||||
throws IOException {
|
throws IOException, ClassNotFoundException {
|
||||||
|
|
||||||
// read the base class
|
// read the base class
|
||||||
final double t = readBaseExternal(in);
|
final double t = readBaseExternal(in);
|
||||||
|
|
||||||
if ((scaled != null) && (nordsieck != null)) {
|
// read the local attributes
|
||||||
|
scalingH = in.readDouble();
|
||||||
|
referenceTime = in.readDouble();
|
||||||
|
|
||||||
|
final int n = (currentState == null) ? -1 : currentState.length;
|
||||||
|
final boolean hasScaled = in.readBoolean();
|
||||||
|
if (hasScaled) {
|
||||||
|
scaled = new double[n];
|
||||||
|
for (int j = 0; j < n; ++j) {
|
||||||
|
scaled[j] = in.readDouble();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
scaled = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
final boolean hasNordsieck = in.readBoolean();
|
||||||
|
if (hasNordsieck) {
|
||||||
|
nordsieck = (Array2DRowRealMatrix) in.readObject();
|
||||||
|
} else {
|
||||||
|
nordsieck = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasScaled && hasNordsieck) {
|
||||||
// we can now set the interpolated time and state
|
// we can now set the interpolated time and state
|
||||||
setInterpolatedTime(t);
|
setInterpolatedTime(t);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,8 @@ public class NordsieckStepInterpolatorTest {
|
||||||
oos.writeObject(handler);
|
oos.writeObject(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
assertTrue(bos.size () > 16000);
|
assertTrue(bos.size () > 20000);
|
||||||
assertTrue(bos.size () < 17000);
|
assertTrue(bos.size () < 25000);
|
||||||
|
|
||||||
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
|
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
|
||||||
ObjectInputStream ois = new ObjectInputStream(bis);
|
ObjectInputStream ois = new ObjectInputStream(bis);
|
||||||
|
|
Loading…
Reference in New Issue