Skip to content

Commit 55a86c2

Browse files
author
Niall Pemberton
committed
IO-214 Inconsistent synchronization of fields
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1002791 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0e7c3a8 commit 55a86c2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/java/org/apache/commons/io/output/ByteArrayOutputStream.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ public ByteArrayOutputStream(int size) {
8888
throw new IllegalArgumentException(
8989
"Negative initial size: " + size);
9090
}
91-
needNewBuffer(size);
91+
synchronized (this) {
92+
needNewBuffer(size);
93+
}
9294
}
9395

9496
/**

0 commit comments

Comments
 (0)