commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r618057 - /commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java
Date Sun, 03 Feb 2008 18:58:56 GMT
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";



Mime
View raw message