From 28738e040521a81fa921384f1c9b926a35a27ac6 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Sun, 5 Apr 2009 19:10:44 +0000 Subject: [PATCH] fixed findbugs warnings and added more explanation about the corresponding behavior in javadoc git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@762136 13f79535-47bb-0310-9956-ffa450edef68 --- findbugs-exclude-filter.xml | 5 +++++ .../math/ode/sampling/MultistepStepInterpolator.java | 2 ++ .../commons/math/ode/sampling/StepInterpolator.java | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/findbugs-exclude-filter.xml b/findbugs-exclude-filter.xml index 9bba586e0..bb74c384c 100644 --- a/findbugs-exclude-filter.xml +++ b/findbugs-exclude-filter.xml @@ -84,6 +84,11 @@ + + + + + diff --git a/src/java/org/apache/commons/math/ode/sampling/MultistepStepInterpolator.java b/src/java/org/apache/commons/math/ode/sampling/MultistepStepInterpolator.java index 1f35598c1..9bb02277c 100644 --- a/src/java/org/apache/commons/math/ode/sampling/MultistepStepInterpolator.java +++ b/src/java/org/apache/commons/math/ode/sampling/MultistepStepInterpolator.java @@ -93,6 +93,8 @@ public abstract class MultistepStepInterpolator } /** Reinitialize the instance + *

Beware that all arrays must be references to integrator + * arrays, in order to ensure proper update without copy.

* @param y reference to the integrator array holding the state at * the end of the step * @param previousT reference to the integrator array holding the times diff --git a/src/java/org/apache/commons/math/ode/sampling/StepInterpolator.java b/src/java/org/apache/commons/math/ode/sampling/StepInterpolator.java index ee3c9100b..1bc507af2 100644 --- a/src/java/org/apache/commons/math/ode/sampling/StepInterpolator.java +++ b/src/java/org/apache/commons/math/ode/sampling/StepInterpolator.java @@ -32,6 +32,14 @@ import org.apache.commons.math.ode.SecondOrderIntegrator; * handlers can use these objects to retrieve the state vector at * intermediate times between the previous and the current grid points * (this feature is often called dense output).

+ *

One important thing to note is that the step handlers may be so + * tightly bound to the integrators that they often share some internal + * state arrays. This imply that one should never use a direct + * reference to a step interpolator outside of the step handler, either + * for future use or for use in another thread. If such a need arise, the + * step interpolator must be copied using the dedicated + * {@link #copy()} method. + *

* * @see FirstOrderIntegrator * @see SecondOrderIntegrator