r27021 - in trunk/freenet/src/freenet: client client/async node support

[email protected] Sat, 18 Apr 2009 20:10:37 +0000
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: juiceman
Date: 2009-04-18 20:10:36 +0000 (Sat, 18 Apr 2009)
New Revision: 27021

Modified:
   trunk/freenet/src/freenet/client/ArchiveManager.java
   trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
   trunk/freenet/src/freenet/client/async/SplitFileFetcher.java
   trunk/freenet/src/freenet/node/FailureTable.java
   trunk/freenet/src/freenet/support/PrioritizedSerialExecutor.java
Log:
Fix some compiler warnings: Redundant casts

Modified: trunk/freenet/src/freenet/client/ArchiveManager.java
===================================================================
--- trunk/freenet/src/freenet/client/ArchiveManager.java	2009-04-18 20:05:16 UTC (rev 27020)
+++ trunk/freenet/src/freenet/client/ArchiveManager.java	2009-04-18 20:10:36 UTC (rev 27021)
@@ -627,7 +627,7 @@
 					Logger.error(this, "storedData is empty but still over limit: cachedData="+cachedData+" / "+maxCachedData);
 					return;
 				}
-				item = (ArchiveStoreItem) storedData.popValue();
+				item = storedData.popValue();
 				long space = item.spaceUsed();
 				cachedData -= space;
 				// Hard limits = delete file within lock, soft limits = delete outside of lock

Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java	2009-04-18 20:05:16 UTC (rev 27020)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java	2009-04-18 20:10:36 UTC (rev 27021)
@@ -100,7 +100,7 @@
 			// Always copy if persistent
 			this.metaStrings = new ArrayList<String>(metaStrings);
 		this.addedMetaStrings = addedMetaStrings;
-		this.clientMetadata = (metadata != null ? (ClientMetadata) metadata.clone() : new ClientMetadata());
+		this.clientMetadata = (metadata != null ? metadata.clone() : new ClientMetadata());
 		thisKey = key.getURI();
 		if(origURI == null) throw new NullPointerException();
 		this.uri = persistent ? origURI.clone() : origURI;
@@ -126,7 +126,7 @@
 		if(persistent && ah != null) ah = ah.cloneHandler();
 		this.ah = fetcher.ah;
 		this.archiveMetadata = null;
-		this.clientMetadata = (fetcher.clientMetadata != null ? (ClientMetadata) fetcher.clientMetadata.clone() : new ClientMetadata());
+		this.clientMetadata = (fetcher.clientMetadata != null ? fetcher.clientMetadata.clone() : new ClientMetadata());
 		this.metadata = newMeta;
 		this.metaStrings = new ArrayList<String>();
 		this.addedMetaStrings = 0;
@@ -770,7 +770,7 @@
 	}
 
 	private String removeMetaString() {
-		String name = (String) metaStrings.remove(0);
+		String name = metaStrings.remove(0);
 		if(addedMetaStrings > 0) addedMetaStrings--;
 		return name;
 	}

Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileFetcher.java	2009-04-18 20:05:16 UTC (rev 27020)
+++ trunk/freenet/src/freenet/client/async/SplitFileFetcher.java	2009-04-18 20:10:36 UTC (rev 27021)
@@ -147,7 +147,7 @@
 		if(decompressors.size() > 1) {
 			Logger.error(this, "Multiple decompressors: "+decompressors.size()+" - this is almost certainly a bug", new Exception("debug"));
 		}
-		this.clientMetadata = clientMetadata == null ? new ClientMetadata() : (ClientMetadata) clientMetadata.clone(); // copy it as in SingleFileFetcher
+		this.clientMetadata = clientMetadata == null ? new ClientMetadata() : clientMetadata.clone(); // copy it as in SingleFileFetcher
 		this.cb = rcb;
 		this.recursionLevel = recursionLevel + 1;
 		this.parent = parent2;

Modified: trunk/freenet/src/freenet/node/FailureTable.java
===================================================================
--- trunk/freenet/src/freenet/node/FailureTable.java	2009-04-18 20:05:16 UTC (rev 27020)
+++ trunk/freenet/src/freenet/node/FailureTable.java	2009-04-18 20:10:36 UTC (rev 27021)
@@ -369,7 +369,7 @@
 	private synchronized void trimOffersList(long now) {
 		while(true) {
 			if(blockOfferListByKey.isEmpty()) return;
-			BlockOfferList bl = (BlockOfferList) blockOfferListByKey.peekValue();
+			BlockOfferList bl = blockOfferListByKey.peekValue();
 			if(bl.isEmpty(now) || bl.expires() < now || blockOfferListByKey.size() > MAX_OFFERS) {
 				if(logMINOR) Logger.minor(this, "Removing block offer list "+bl+" list size now "+blockOfferListByKey.size());
 				blockOfferListByKey.popKey();

Modified: trunk/freenet/src/freenet/support/PrioritizedSerialExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PrioritizedSerialExecutor.java	2009-04-18 20:05:16 UTC (rev 27020)
+++ trunk/freenet/src/freenet/support/PrioritizedSerialExecutor.java	2009-04-18 20:10:36 UTC (rev 27021)
@@ -126,7 +126,7 @@
 					if(!jobs[i].isEmpty()) {
 						if(logMINOR)
 							Logger.minor(this, "Chosen job at priority "+i);
-						return (Runnable) jobs[i].removeFirst();
+						return jobs[i].removeFirst();
 					}
 				}
 			} else {
@@ -134,7 +134,7 @@
 					if(!jobs[i].isEmpty()) {
 						if(logMINOR)
 							Logger.minor(this, "Chosen job at priority "+i);
-						return (Runnable) jobs[i].removeFirst();
+						return jobs[i].removeFirst();
 					}
 				}
 			}