Author: toad
Date: 2009-04-03 14:36:12 +0000 (Fri, 03 Apr 2009)
New Revision: 26446
Modified:
trunk/freenet/src/freenet/client/async/PersistentChosenRequest.java
Log:
indent
Modified: trunk/freenet/src/freenet/client/async/PersistentChosenRequest.java
===================================================================
--- trunk/freenet/src/freenet/client/async/PersistentChosenRequest.java
2009-04-03 14:35:29 UTC (rev 26445)
+++ trunk/freenet/src/freenet/client/async/PersistentChosenRequest.java
2009-04-03 14:36:12 UTC (rev 26446)
@@ -236,30 +236,30 @@
public ChosenBlock grabNotStarted(Random random, RequestScheduler
sched) {
ArrayList<PersistentChosenBlock> dumped = null;
try {
- synchronized(this) {
- while(true) {
- int size = blocksNotStarted.size();
- if(size == 0) return null;
- PersistentChosenBlock ret;
- if(size == 1) ret = blocksNotStarted.remove(0);
- else ret =
blocksNotStarted.remove(random.nextInt(size));
- Key key = ret.key;
- if(key != null && sched.hasFetchingKey(key)) {
- // Already fetching; remove from list.
- if(dumped == null) dumped = new
ArrayList<PersistentChosenBlock>();
- dumped.add(ret);
- continue;
+ synchronized(this) {
+ while(true) {
+ int size = blocksNotStarted.size();
+ if(size == 0) return null;
+ PersistentChosenBlock ret;
+ if(size == 1) ret =
blocksNotStarted.remove(0);
+ else ret =
blocksNotStarted.remove(random.nextInt(size));
+ Key key = ret.key;
+ if(key != null &&
sched.hasFetchingKey(key)) {
+ // Already fetching; remove
from list.
+ if(dumped == null) dumped = new
ArrayList<PersistentChosenBlock>();
+ dumped.add(ret);
+ continue;
+ }
+ blocksStarted.add(ret);
+ return ret;
+ }
}
- blocksStarted.add(ret);
- return ret;
- }
- }
} finally {
- if(dumped != null) {
- for(PersistentChosenBlock block : dumped)
- block.onDumped();
+ if(dumped != null) {
+ for(PersistentChosenBlock block : dumped)
+ block.onDumped();
+ }
}
- }
}
public synchronized int sizeNotStarted() {
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs