added a missing synchronized bloc

JIRA: MATH-183

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@618057 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2008-02-03 18:58:54 +00:00
parent 5c090bf605
commit fc4b86252e
1 changed files with 4 additions and 2 deletions

View File

@ -623,8 +623,10 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
*/
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";