[freenet-cvs] r17888 - in trunk/freenet/src/freenet: clients/http/bookmark node node/useralerts support/math

jflesch at freenetproject.org jflesch at freenetproject.org
Wed Feb 13 23:53:32 UTC 2008


Author: jflesch
Date: 2008-02-13 23:53:32 +0000 (Wed, 13 Feb 2008)
New Revision: 17888

Modified:
   trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
   trunk/freenet/src/freenet/node/RequestHandler.java
   trunk/freenet/src/freenet/node/VersionParseException.java
   trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java
   trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java
Log:
Remove unused private methods + add serialVersionUID where needed

Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java	2008-02-13 23:09:12 UTC (rev 17887)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java	2008-02-13 23:53:32 UTC (rev 17888)
@@ -10,8 +10,6 @@
 import java.net.MalformedURLException;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.Iterator;
-
 import freenet.client.async.USKCallback;
 import freenet.keys.FreenetURI;
 import freenet.keys.USK;
@@ -216,26 +214,6 @@
 			storeBookmarks();
 	}
 
-	private BookmarkCategory makeParents(String path) {
-		boolean isInPath = false;
-		synchronized(bookmarks) {
-			isInPath = bookmarks.containsKey(path);
-		}
-		if(isInPath)
-			return getCategoryByPath(path);
-		else {
-
-			int index = path.substring(0, path.length() - 1).lastIndexOf("/");
-			String name = path.substring(index + 1, path.length() - 1);
-
-			BookmarkCategory cat = new BookmarkCategory(name);
-			makeParents(parentPath(path));
-			addBookmark(parentPath(path), cat);
-
-			return cat;
-		}
-	}
-
 	private void putPaths(String path, Bookmark b) {
 		synchronized(bookmarks) {
 			bookmarks.put(path, b);
@@ -347,43 +325,7 @@
 			storeBookmarks();
 	}
 
-	/* FIXME: remove that kludge when 1076 is out */
-	private void _innerReadTrunkBookmarks(String prefix, BookmarkCategory category, SimpleFieldSet sfs) {
-		boolean hasBeenParsedWithoutAnyProblem = true;
-		boolean isRoot = ("".equals(prefix) && MAIN_CATEGORY.equals(category));
-		synchronized(bookmarks) {
-			if(!isRoot)
-				putPaths(prefix + category.name + '/', category);
 
-			String[] categories = sfs.namesOfDirectSubsets();
-			for(int i = 0; i < categories.length; i++) {
-				SimpleFieldSet subset = sfs.subset(categories[i]);
-				BookmarkCategory currentCategory = new BookmarkCategory(categories[i]);
-				String name = prefix + category.name + '/';
-				category.addBookmark(currentCategory);
-				_innerReadTrunkBookmarks((isRoot ? "/" : name), currentCategory, subset);
-			}
-
-			Iterator it = sfs.toplevelKeyIterator();
-			while(it.hasNext()) {
-				String key = (String) it.next();
-				String line = sfs.get(key);
-				try {
-					BookmarkItem item = new BookmarkItem(line, node.alerts);
-					String name = (isRoot ? "" : prefix + category.name) + '/' + item.name;
-					putPaths(name, item);
-					category.addBookmark(item);
-					subscribeToUSK(item);
-				} catch(MalformedURLException e) {
-					Logger.error(this, "Error while adding one of the bookmarks :" + e.getMessage(), e);
-					hasBeenParsedWithoutAnyProblem = false;
-				}
-			}
-		}
-		if(hasBeenParsedWithoutAnyProblem)
-			storeBookmarks();
-	}
-
 	public SimpleFieldSet toSimpleFieldSet() {
 		SimpleFieldSet sfs = new SimpleFieldSet(true);
 

Modified: trunk/freenet/src/freenet/node/RequestHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestHandler.java	2008-02-13 23:09:12 UTC (rev 17887)
+++ trunk/freenet/src/freenet/node/RequestHandler.java	2008-02-13 23:53:32 UTC (rev 17888)
@@ -333,12 +333,7 @@
 		}
 	}
 
-    private PeerNode[] sourceAsArray() {
-    	if(source == null) return null;
-    	else return new PeerNode[] { source };
-	}
-
-	/**
+    /**
      * Return data from the datastore.
      * @param block The block we found in the datastore.
      * @throws NotConnectedException If we lose the connected to the request source.

Modified: trunk/freenet/src/freenet/node/VersionParseException.java
===================================================================
--- trunk/freenet/src/freenet/node/VersionParseException.java	2008-02-13 23:09:12 UTC (rev 17887)
+++ trunk/freenet/src/freenet/node/VersionParseException.java	2008-02-13 23:53:32 UTC (rev 17888)
@@ -8,6 +8,7 @@
  * @author toad
  */
 public class VersionParseException extends Exception {
+	private static final long serialVersionUID = -19006235321212642L;
 
 	public VersionParseException(String msg) {
 		super(msg);

Modified: trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java	2008-02-13 23:09:12 UTC (rev 17887)
+++ trunk/freenet/src/freenet/node/useralerts/InvalidAddressOverrideUserAlert.java	2008-02-13 23:53:32 UTC (rev 17888)
@@ -30,14 +30,6 @@
 		return L10n.getString("InvalidAddressOverrideUserAlert."+key);
 	}
 
-	private String l10n(String key, String pattern, String value) {
-		return L10n.getString("InvalidAddressOverrideUserAlert."+key, pattern, value);
-	}
-
-	private String l10n(String key, String[] patterns, String[] values) {
-		return L10n.getString("InvalidAddressOverrideUserAlert."+key, patterns, values);
-	}
-
 	public HTMLNode getHTMLText() {
 		SubConfig sc = node.config.get("node");
 		Option o = sc.getOption("ipAddressOverride");

Modified: trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java
===================================================================
--- trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java	2008-02-13 23:09:12 UTC (rev 17887)
+++ trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java	2008-02-13 23:53:32 UTC (rev 17888)
@@ -13,6 +13,7 @@
  * A filter on BootstrappingDecayingRunningAverage which makes it aware of the circular keyspace.
  */
 public class DecayingKeyspaceAverage implements RunningAverage {
+	private static final long serialVersionUID = 5129429614949179428L;
 	/**
 	 'avg' is the normalized average location, note that the the reporting bounds are (-2.0, 2.0) however.
 	 */




More information about the cvs mailing list