From 6500be3b99f32ba5a8d2cd5aa837f52fa363d63f Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Fri, 29 Mar 2013 15:48:57 +0000 Subject: [PATCH] Fixed findbugs warning. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1462504 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/math3/util/ResizableDoubleArray.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java b/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java index ae4abecae..4fb9da331 100644 --- a/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java +++ b/src/main/java/org/apache/commons/math3/util/ResizableDoubleArray.java @@ -934,7 +934,15 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { * @since 3.1 */ public double compute(MathArrays.Function f) { - return f.evaluate(internalArray, startIndex, numElements); + final double[] array; + final int start; + final int num; + synchronized(this) { + array = internalArray; + start = startIndex; + num = numElements; + } + return f.evaluate(array, start, num); } /**