Author: nextgens
Date: 2008-04-19 05:46:59 +0000 (Sat, 19 Apr 2008)
New Revision: 19410
Modified:
trunk/freenet/src/freenet/support/io/BaseFileBucket.java
Log:
revert r19297
Modified: trunk/freenet/src/freenet/support/io/BaseFileBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/BaseFileBucket.java 2008-04-19
05:42:36 UTC (rev 19409)
+++ trunk/freenet/src/freenet/support/io/BaseFileBucket.java 2008-04-19
05:46:59 UTC (rev 19410)
@@ -393,27 +393,17 @@
if(toClose != null) {
Logger.error(this, "Streams open free()ing "+this+" :
"+StringArray.toString(toClose), new Exception("debug"));
- double toCloseLength = toClose.length;
- while(toCloseLength > 0) {
- int toCloseThisRound;
- if(toCloseLength <= Integer.MAX_VALUE) {
- toCloseThisRound = (int) toCloseLength;
- toCloseLength = 0;
- } else
- toCloseLength -= (toCloseThisRound =
Integer.MAX_VALUE);
-
- for(int i=0; i<toCloseThisRound; i++) {
- try {
- if(toClose[i] instanceof
FileBucketOutputStream) {
-
((FileBucketOutputStream) toClose[i]).close();
- } else {
-
((FileBucketInputStream) toClose[i]).close();
- }
- } catch (IOException e) {
- Logger.error(this, "Caught
closing stream in free(): "+e, e);
- } catch (Throwable t) {
- Logger.error(this, "Caught
closing stream in free(): "+t, t);
+ for(int i=0;i<toClose.length;i++) {
+ try {
+ if(toClose[i] instanceof
FileBucketOutputStream) {
+ ((FileBucketOutputStream)
toClose[i]).close();
+ } else {
+ ((FileBucketInputStream)
toClose[i]).close();
}
+ } catch (IOException e) {
+ Logger.error(this, "Caught closing
stream in free(): "+e, e);
+ } catch (Throwable t) {
+ Logger.error(this, "Caught closing
stream in free(): "+t, t);
}
}
}