Author: nextgens
Date: 2008-08-31 08:22:20 +0000 (Sun, 31 Aug 2008)
New Revision: 22267
Modified:
trunk/freenet/src/freenet/support/io/ArrayBucket.java
Log:
ArrayBucket: better this way
Modified: trunk/freenet/src/freenet/support/io/ArrayBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/ArrayBucket.java 2008-08-31
08:11:21 UTC (rev 22266)
+++ trunk/freenet/src/freenet/support/io/ArrayBucket.java 2008-08-31
08:22:20 UTC (rev 22267)
@@ -85,12 +85,13 @@
super();
}
- public void close() throws IOException {
+ @Override
+ public synchronized void close() throws IOException {
if(hasBeenClosed) return;
- hasBeenClosed = true;
data.add(super.toByteArray());
if(readOnly) throw new IOException("Read only");
// FIXME maybe we should throw on write instead? :)
+ hasBeenClosed = true;
}
}