[freenet-cvs] r18711 - trunk/freenet/src/freenet/client/async

2008-03-21 Thread [email protected]
Author: toad
Date: 2008-03-21 23:09:03 + (Fri, 21 Mar 2008)
New Revision: 18711

Modified:
   trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
Log:
indenting

Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
===
--- trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java  
2008-03-21 23:08:25 UTC (rev 18710)
+++ trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java  
2008-03-21 23:09:03 UTC (rev 18711)
@@ -102,31 +102,31 @@
private Object removeRandomBlockNum(KeysFetchingLocally keys) {
logMINOR = Logger.shouldLog(Logger.MINOR, this);
synchronized(this) {
-   if(blockNums.isEmpty()) {
-   if(logMINOR)
-   Logger.minor(this, "No blocks to remove");
-   return null;
+   if(blockNums.isEmpty()) {
+   if(logMINOR)
+   Logger.minor(this, "No blocks to 
remove");
+   return null;
+   }
}
-   }
for(int i=0;i<10;i++) {
-   Object ret;
-   int x;
-   synchronized(this) {
-   x = ctx.random.nextInt(blockNums.size());
-   ret = (Integer) blockNums.remove(x);
-   }
-   // LOCKING: keys is safe to check, but segment isn't.
-   Key key = segment.getBlockNodeKey(((Integer)ret).intValue());
-   if(keys.hasKey(key)) {
+   Object ret;
+   int x;
synchronized(this) {
-   blockNums.add(ret);
+   x = ctx.random.nextInt(blockNums.size());
+   ret = (Integer) blockNums.remove(x);
}
-   continue;
+   // LOCKING: keys is safe to check, but segment isn't.
+   Key key = 
segment.getBlockNodeKey(((Integer)ret).intValue());
+   if(keys.hasKey(key)) {
+   synchronized(this) {
+   blockNums.add(ret);
+   }
+   continue;
+   }
+   if(logMINOR)
+   Logger.minor(this, "Removing block "+x+" of 
"+(blockNums.size()+1)+ " : "+ret+ " on "+this);
+   return ret;
}
-   if(logMINOR)
-   Logger.minor(this, "Removing block "+x+" of 
"+(blockNums.size()+1)+ " : "+ret+ " on "+this);
-   return ret;
-   }
return null;
}





[freenet-cvs] r18711 - trunk/freenet/src/freenet/client/async

2008-03-21 Thread toad
Author: toad
Date: 2008-03-21 23:09:03 + (Fri, 21 Mar 2008)
New Revision: 18711

Modified:
   trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
Log:
indenting

Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
===
--- trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java  
2008-03-21 23:08:25 UTC (rev 18710)
+++ trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java  
2008-03-21 23:09:03 UTC (rev 18711)
@@ -102,31 +102,31 @@
private Object removeRandomBlockNum(KeysFetchingLocally keys) {
logMINOR = Logger.shouldLog(Logger.MINOR, this);
synchronized(this) {
-   if(blockNums.isEmpty()) {
-   if(logMINOR)
-   Logger.minor(this, "No blocks to remove");
-   return null;
+   if(blockNums.isEmpty()) {
+   if(logMINOR)
+   Logger.minor(this, "No blocks to 
remove");
+   return null;
+   }
}
-   }
for(int i=0;i<10;i++) {
-   Object ret;
-   int x;
-   synchronized(this) {
-   x = ctx.random.nextInt(blockNums.size());
-   ret = (Integer) blockNums.remove(x);
-   }
-   // LOCKING: keys is safe to check, but segment isn't.
-   Key key = segment.getBlockNodeKey(((Integer)ret).intValue());
-   if(keys.hasKey(key)) {
+   Object ret;
+   int x;
synchronized(this) {
-   blockNums.add(ret);
+   x = ctx.random.nextInt(blockNums.size());
+   ret = (Integer) blockNums.remove(x);
}
-   continue;
+   // LOCKING: keys is safe to check, but segment isn't.
+   Key key = 
segment.getBlockNodeKey(((Integer)ret).intValue());
+   if(keys.hasKey(key)) {
+   synchronized(this) {
+   blockNums.add(ret);
+   }
+   continue;
+   }
+   if(logMINOR)
+   Logger.minor(this, "Removing block "+x+" of 
"+(blockNums.size()+1)+ " : "+ret+ " on "+this);
+   return ret;
}
-   if(logMINOR)
-   Logger.minor(this, "Removing block "+x+" of 
"+(blockNums.size()+1)+ " : "+ret+ " on "+this);
-   return ret;
-   }
return null;
}
 

___
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs