You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2008/02/03 19:58:56 UTC

svn commit: r618057 - /commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java

Author: luc
Date: Sun Feb  3 10:58:54 2008
New Revision: 618057

URL: http://svn.apache.org/viewvc?rev=618057&view=rev
Log:
added a missing synchronized bloc
JIRA: MATH-183

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java?rev=618057&r1=618056&r2=618057&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java Sun Feb  3 10:58:54 2008
@@ -623,8 +623,10 @@
      */
     protected void setInitialCapacity(int initialCapacity) {
         if (initialCapacity > 0) {
-            this.initialCapacity = initialCapacity;
-        } else {
+            synchronized(this) {
+                this.initialCapacity = initialCapacity;
+            }
+            } else {
             String msg =
                 "The initial capacity supplied: " + initialCapacity +
                 "must be a positive integer";