Author: toad
Date: 2008-09-25 01:21:24 +0000 (Thu, 25 Sep 2008)
New Revision: 22832
Added:
branches/db4o/freenet/test/freenet/support/DoublyLinkedListImplTest.java
Modified:
branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
branches/db4o/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
branches/db4o/freenet/src/freenet/clients/http/ConnectionsToadlet.java
branches/db4o/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
branches/db4o/freenet/src/freenet/clients/http/QueueToadlet.java
branches/db4o/freenet/src/freenet/clients/http/ToadletContextImpl.java
branches/db4o/freenet/src/freenet/clients/http/WelcomeToadlet.java
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex
branches/db4o/freenet/src/freenet/clients/http/filter/ContentDataFilter.java
branches/db4o/freenet/src/freenet/clients/http/filter/GIFFilter.java
branches/db4o/freenet/src/freenet/clients/http/filter/HTMLFilter.java
branches/db4o/freenet/src/freenet/crypt/DiffieHellman.java
branches/db4o/freenet/src/freenet/l10n/freenet.l10n.de.properties
branches/db4o/freenet/src/freenet/l10n/freenet.l10n.en.properties
branches/db4o/freenet/src/freenet/l10n/freenet.l10n.es.properties
branches/db4o/freenet/src/freenet/l10n/freenet.l10n.it.properties
branches/db4o/freenet/src/freenet/node/AnnounceSender.java
branches/db4o/freenet/src/freenet/node/CHKInsertSender.java
branches/db4o/freenet/src/freenet/node/NetworkIDManager.java
branches/db4o/freenet/src/freenet/node/Node.java
branches/db4o/freenet/src/freenet/node/NodeDispatcher.java
branches/db4o/freenet/src/freenet/node/PacketSender.java
branches/db4o/freenet/src/freenet/node/PeerManager.java
branches/db4o/freenet/src/freenet/node/PeerNode.java
branches/db4o/freenet/src/freenet/node/RequestSender.java
branches/db4o/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
branches/db4o/freenet/src/freenet/node/SSKInsertSender.java
branches/db4o/freenet/src/freenet/node/Version.java
branches/db4o/freenet/src/freenet/node/simulator/BootstrapPullTest.java
branches/db4o/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java
branches/db4o/freenet/src/freenet/node/simulator/BootstrapSeedTest.java
branches/db4o/freenet/src/freenet/node/simulator/SeednodePingTest.java
branches/db4o/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
branches/db4o/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
branches/db4o/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
branches/db4o/freenet/src/freenet/support/BloomFilter.java
branches/db4o/freenet/src/freenet/support/DoublyLinkedList.java
branches/db4o/freenet/src/freenet/support/DoublyLinkedListImpl.java
branches/db4o/freenet/src/freenet/support/Fields.java
branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
branches/db4o/freenet/src/freenet/support/transport/ip/IPAddressDetector.java
Log:
Merge 1163 into db4o branch: 22508 -> 22610
Modified: branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/client/async/SingleFileInserter.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -370,7 +370,6 @@
boolean metaInsertSetBlocks;
boolean metaInsertStarted;
boolean metaFetchable;
- boolean dataFetchable;
final boolean persistent;
/**
@@ -741,8 +740,6 @@
Logger.error(this, "onFetchable
for unknown state "+state);
return;
}
- if(dataFetchable) return;
- dataFetchable = true;
if(persistent)
container.set(this);
if(logMINOR) Logger.minor(this, "Data
fetchable");
Modified:
branches/db4o/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/BookmarkEditorToadlet.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -323,6 +323,12 @@
Bookmark newBookmark;
if("addItem".equals(action)) {
FreenetURI key = new
FreenetURI(req.getPartAsString("key", MAX_KEY_LENGTH));
+ /* TODO:
+ * <nextgens> I suggest you
implement a HTTPRequest.getBoolean(String name) using Fields.stringtobool
+ * <nextgens>
HTTPRequest.getBoolean(String name, boolean default) even
+ *
+ * - values as "on", "true",
"yes" should be accepted.
+ */
boolean hasAnActivelink =
req.isPartSet("hasAnActivelink");
newBookmark = new
BookmarkItem(key, name, req.getPartAsString("descB", MAX_KEY_LENGTH),
hasAnActivelink, core.alerts);
} else
Modified: branches/db4o/freenet/src/freenet/clients/http/ConnectionsToadlet.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/ConnectionsToadlet.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/ConnectionsToadlet.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -83,9 +83,9 @@
}
}
- // TODO: use Long.valueOf().compare when we switch to 1.5
+ // TODO: check why we do not just return the result of
(long1-long2)
private int compareLongs(long long1, long long2) {
- long diff = long1 - long2;
+ int diff = Long.valueOf(long1).compareTo(long2);
if(diff == 0)
return 0;
else
@@ -93,7 +93,7 @@
}
private int compareInts(int int1, int int2) {
- int diff = int1 -int2;
+ int diff = Integer.valueOf(int1).compareTo(int2);
if(diff == 0)
return 0;
else
@@ -120,7 +120,6 @@
long total2 =
secondNode.getTotalInputBytes()+secondNode.getTotalOutputBytes();
return compareLongs(total1, total2);
}else if(sortBy.equals("selection_percentage")){
- long sinceWhen = System.currentTimeMillis() -
PeerNode.SELECTION_SAMPLING_PERIOD;
return
Double.compare(firstNode.getSelectionRate(), secondNode.getSelectionRate());
}else if(sortBy.equals("time_delta")){
return compareLongs(firstNode.getClockDelta(),
secondNode.getClockDelta());
Modified:
branches/db4o/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/FirstTimeWizardToadlet.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -215,7 +215,9 @@
HTMLNode bandwidthForm =
ctx.addFormChild(bandwidthInfoboxContent, ".", "dsForm");
HTMLNode result = bandwidthForm.addChild("select",
"name", "ds");
- result.addChild("option", "value", "2G", "2GiB");
+ result.addChild("option", "value", "512M", "512MiB");
+ result.addChild("option", "value", "1G", "1GiB");
+ result.addChild("option", new String[] { "value",
"selected" }, new String[] { "2G", "on" }, "2GiB");
result.addChild("option", "value", "3G", "3GiB");
result.addChild("option", "value", "5G", "5GiB");
result.addChild("option", "value", "10G", "10GiB");
@@ -364,6 +366,7 @@
}
core.node.securityLevels.setThreatLevel(newThreatLevel);
super.writeTemporaryRedirect(ctx, "step1",
TOADLET_URL+"?step="+WIZARD_STEP.SECURITY_FRIENDS);
+ return;
} else
if(request.isPartSet("security-levels.friendsThreatLevel")) {
// We don't require a confirmation here, since it's one
page at a time, so there's less information to
// confuse the user, and we don't know whether the node
has friends yet etc.
@@ -402,6 +405,7 @@
}
core.node.securityLevels.setThreatLevel(newThreatLevel);
super.writeTemporaryRedirect(ctx, "step1",
TOADLET_URL+"?step="+WIZARD_STEP.SECURITY_PHYSICAL);
+ return;
} else
if(request.isPartSet("security-levels.physicalThreatLevel")) {
// We don't require a confirmation here, since it's one
page at a time, so there's less information to
// confuse the user, and we don't know whether the node
has friends yet etc.
@@ -415,6 +419,7 @@
core.node.securityLevels.setThreatLevel(newThreatLevel);
core.storeConfig();
super.writeTemporaryRedirect(ctx, "step1",
TOADLET_URL+"?step="+WIZARD_STEP.NAME_SELECTION+"&opennet="+core.node.isOpennetEnabled());
+ return;
} else if(request.isPartSet("nnameF")) {
String selectedNName = request.getPartAsString("nname",
128);
try {
Modified: branches/db4o/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/QueueToadlet.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/QueueToadlet.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -215,7 +215,7 @@
writePermanentRedirect(ctx, "Done",
"/queue/");
return;
}
- LinkedList success = new LinkedList(), failure
= new LinkedList();
+ LinkedList<String> success = new LinkedList(),
failure = new LinkedList();
for(int i=0; i<keys.length; i++) {
String currentKey = keys[i];
@@ -236,14 +236,14 @@
HTMLNode contentNode =
ctx.getPageMaker().getContentNode(pageNode);
HTMLNode alertNode =
contentNode.addChild(ctx.getPageMaker().getInfobox((displayFailureBox ?
"infobox-warning" : "infobox-info"),
L10n.getString("QueueToadlet.downloadFiles")));
HTMLNode alertContent =
ctx.getPageMaker().getContentNode(alertNode);
- Iterator it;
+ Iterator<String> it;
if(displaySuccessBox) {
HTMLNode successDiv =
alertContent.addChild("ul");
successDiv.addChild("#",
L10n.getString("QueueToadlet.enqueuedSuccessfully", "number",
String.valueOf(success.size())));
it = success.iterator();
while(it.hasNext()) {
HTMLNode line =
successDiv.addChild("li");
- line.addChild("#", (String)
it.next());
+ line.addChild("#", it.next());
}
successDiv.addChild("br");
}
@@ -254,7 +254,7 @@
it = failure.iterator();
while(it.hasNext()) {
HTMLNode line =
failureDiv.addChild("li");
- line.addChild("#",
(String) it.next());
+ line.addChild("#",
it.next());
}
}
failureDiv.addChild("br");
@@ -560,18 +560,18 @@
private HTMLNode handleGetInner(PageMaker pageMaker, final
ObjectContainer container, ClientContext context, final HTTPRequest request,
ToadletContext ctx) {
// First, get the queued requests, and separate them into
different types.
- LinkedList completedDownloadToDisk = new LinkedList();
- LinkedList completedDownloadToTemp = new LinkedList();
- LinkedList completedUpload = new LinkedList();
- LinkedList completedDirUpload = new LinkedList();
+ LinkedList<ClientRequest> completedDownloadToDisk = new
LinkedList();
+ LinkedList<ClientRequest> completedDownloadToTemp = new
LinkedList();
+ LinkedList<ClientRequest> completedUpload = new LinkedList();
+ LinkedList<ClientRequest> completedDirUpload = new LinkedList();
- LinkedList failedDownload = new LinkedList();
- LinkedList failedUpload = new LinkedList();
- LinkedList failedDirUpload = new LinkedList();
+ LinkedList<ClientRequest> failedDownload = new LinkedList();
+ LinkedList<ClientRequest> failedUpload = new LinkedList();
+ LinkedList<ClientRequest> failedDirUpload = new LinkedList();
- LinkedList uncompletedDownload = new LinkedList();
- LinkedList uncompletedUpload = new LinkedList();
- LinkedList uncompletedDirUpload = new LinkedList();
+ LinkedList<ClientRequest> uncompletedDownload = new
LinkedList();
+ LinkedList<ClientRequest> uncompletedUpload = new LinkedList();
+ LinkedList<ClientRequest> uncompletedDirUpload = new
LinkedList();
ClientRequest[] reqs = fcp.getGlobalRequests(container);
if(Logger.shouldLog(Logger.MINOR, this))
@@ -654,11 +654,8 @@
System.err.println("Total queued downloads:
"+SizeUtil.formatSize(totalQueuedDownloadSize));
System.err.println("Total queued uploads:
"+SizeUtil.formatSize(totalQueuedUploadSize));
- Comparator jobComparator = new Comparator() {
- public int compare(Object first, Object second) {
- ClientRequest firstRequest = (ClientRequest)
first;
- ClientRequest secondRequest = (ClientRequest)
second;
-
+ Comparator<ClientRequest> jobComparator = new
Comparator<ClientRequest>() {
+ public int compare(ClientRequest firstRequest,
ClientRequest secondRequest) {
int result = 0;
boolean isSet = true;
@@ -1134,7 +1131,7 @@
return downloadBox;
}
- private HTMLNode createRequestTable(PageMaker pageMaker, ToadletContext
ctx, List requests, int[] columns, String[] priorityClasses, boolean
advancedModeEnabled, boolean isUpload, ObjectContainer container) {
+ private HTMLNode createRequestTable(PageMaker pageMaker, ToadletContext
ctx, List<ClientRequest> requests, int[] columns, String[] priorityClasses,
boolean advancedModeEnabled, boolean isUpload, ObjectContainer container) {
HTMLNode table = new HTMLNode("table", "class", "requests");
HTMLNode headerRow = table.addChild("tr", "class",
"table-header");
headerRow.addChild("th");
@@ -1167,8 +1164,7 @@
headerRow.addChild("th",
L10n.getString("QueueToadlet.reason"));
}
}
- for (Iterator requestItems = requests.iterator();
requestItems.hasNext(); ) {
- ClientRequest clientRequest = (ClientRequest)
requestItems.next();
+ for (ClientRequest clientRequest : requests) {
HTMLNode requestRow = table.addChild("tr", "class",
"priority" + clientRequest.getPriority());
requestRow.addChild(createDeleteCell(pageMaker,
clientRequest.getIdentifier(), clientRequest, ctx));
@@ -1236,9 +1232,9 @@
/**
* List of completed request identifiers which the user hasn't
acknowledged yet.
*/
- private final HashSet completedRequestIdentifiers = new HashSet();
+ private final HashSet<String> completedRequestIdentifiers = new
HashSet();
- private final HashMap alertsByIdentifier = new HashMap();
+ private final HashMap<String, UserAlert> alertsByIdentifier = new
HashMap();
public void notifyFailure(ClientRequest req, ObjectContainer container)
{
// FIXME do something???
@@ -1271,7 +1267,7 @@
public void run(ObjectContainer container,
ClientContext context) {
String[] identifiers;
synchronized(completedRequestIdentifiers) {
- identifiers = (String[])
completedRequestIdentifiers.toArray(new
String[completedRequestIdentifiers.size()]);
+ identifiers =
completedRequestIdentifiers.toArray(new
String[completedRequestIdentifiers.size()]);
}
for(int i=0;i<identifiers.length;i++) {
ClientRequest req =
fcp.getGlobalRequest(identifiers[i], container);
@@ -1333,7 +1329,7 @@
bw = new BufferedWriter(osw);
String[] identifiers;
synchronized(completedRequestIdentifiers) {
- identifiers = (String[])
completedRequestIdentifiers.toArray(new
String[completedRequestIdentifiers.size()]);
+ identifiers =
completedRequestIdentifiers.toArray(new
String[completedRequestIdentifiers.size()]);
}
for(int i=0;i<identifiers.length;i++)
bw.write(identifiers[i]+'\n');
@@ -1495,7 +1491,7 @@
}
UserAlert alert;
synchronized(alertsByIdentifier) {
- alert = (UserAlert)
alertsByIdentifier.remove(identifier);
+ alert = alertsByIdentifier.remove(identifier);
}
core.alerts.unregister(alert);
saveCompletedIdentifiersOffThread();
Modified: branches/db4o/freenet/src/freenet/clients/http/ToadletContextImpl.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/ToadletContextImpl.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/ToadletContextImpl.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -44,6 +44,7 @@
private final BucketFactory bf;
private final ToadletContainer container;
private final InetAddress remoteAddr;
+ private boolean sentReplyHeaders;
/** Is the context closed? If so, don't allow any more writes. This is
because there
* may be later requests.
@@ -128,6 +129,10 @@
public void sendReplyHeaders(int replyCode, String replyDescription,
MultiValueTable mvt, String mimeType, long contentLength, Date mTime) throws
ToadletContextClosedException, IOException {
if(closed) throw new ToadletContextClosedException();
+ if(sentReplyHeaders) {
+ throw new IllegalStateException("Already sent
headers!");
+ }
+ sentReplyHeaders = true;
sendReplyHeaders(sockOutputStream, replyCode, replyDescription,
mvt, mimeType, contentLength, mTime, shouldDisconnect);
}
Modified: branches/db4o/freenet/src/freenet/clients/http/WelcomeToadlet.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/WelcomeToadlet.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/WelcomeToadlet.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -6,7 +6,6 @@
import java.io.File;
import java.io.IOException;
import java.net.URI;
-import java.net.URISyntaxException;
import java.util.HashSet;
import org.tanukisoftware.wrapper.WrapperManager;
@@ -49,11 +48,6 @@
this.node = node;
this.core = core;
this.bookmarkManager = bookmarks;
- try {
- manageBookmarksURI = new URI("/welcome/?managebookmarks");
- } catch (URISyntaxException e) {
- throw new Error(e);
- }
}
void redirectToRoot(ToadletContext ctx) throws
ToadletContextClosedException, IOException {
@@ -62,7 +56,6 @@
ctx.sendReplyHeaders(302, "Found", headers, null, 0);
return;
}
- URI manageBookmarksURI;
private void addCategoryToList(BookmarkCategory cat, HTMLNode list,
boolean noActiveLinks) {
BookmarkItems items = cat.getItems();
Modified:
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
===================================================================
---
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
2008-09-25 01:00:29 UTC (rev 22831)
+++
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -1,10 +1,11 @@
-/* The following code was generated by JFlex 1.4.1 on 13-aug-07 8:18:51 */
+/* The following code was generated by JFlex 1.4.1 on 9/8/08 7:31 PM */
/* This code is part of Freenet. It is distributed under the GNU General
* Public License, version 2 (or at your option any later version). See
* http://www.gnu.org/ for further details of the GPL. */
package freenet.clients.http.filter;
import java.io.*;
+import java.util.*;
import freenet.l10n.L10n;
/* This class tokenizes a CSS2 Reader stream, writes it out to the output
Writer, and filters any URLs found */
// WARNING: this is not as thorough as the HTML parser - new versions of the
standard could lead to anonymity risks. See comments in SaferFilter.java
@@ -12,12 +13,13 @@
// just needs somebody to go over the standard carefully and eliminate
everything that isn't sufficiently specific (e.g. matching a '-' on its own).
// Mostly from http://www.w3.org/TR/REC-CSS2/grammar.html
+ at SuppressWarnings("fallthrough")
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.4.1
- * on 13-aug-07 8:18:51 from the specification file
- * <tt>freenet/clients/http/filter/CSSTokenizerFilter.jflex</tt>
+ * on 9/8/08 7:31 PM from the specification file
+ * <tt>src/freenet/clients/http/filter/CSSTokenizerFilter.jflex</tt>
*/
class CSSTokenizerFilter {
@@ -879,6 +881,23 @@
from input */
private int zzEndRead;
+ /** number of newlines encountered up to the start of the matched text */
+ private int yyline;
+
+ /** the number of characters up to the start of the matched text */
+ private int yychar;
+
+ /**
+ * the number of characters from the last newline up to the start of the
+ * matched text
+ */
+ private int yycolumn;
+
+ /**
+ * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+ */
+ private boolean zzAtBOL = true;
+
/** zzAtEOF == true <=> the scanner is at the EOF */
private boolean zzAtEOF;
@@ -993,35 +1012,13 @@
// Ignore one whitespace char
after an escape
int d =
Integer.parseInt(hexEscape.toString(),
16);
- // FIXME once we can use 1.5,
use Characters.toChars(int).
- if(d > 0xFFFF) {
- String error =
-
l10n("supplementalCharsNotSupported");
- logError(error);
- try {
- w.write("/*
"+error+"*/");
- } catch (IOException e)
{};
- } else {
- c = (char)d;
- buffer.append(c);
- }
+ buffer.append(new
String(Character.toChars(d)));
stillEscaping = false;
hexEscape = new StringBuilder();
} else {
int d =
Integer.parseInt(hexEscape.toString(),
16);
- // FIXME once we can use 1.5,
use Characters.toChars(int).
- if(d > 0xFFFF) {
- String error =
-
l10n("supplementalCharsNotSupported");
- logError(error);
- try {
- w.write("/*
"+error+"*/");
- } catch (IOException e)
{};
- } else {
- char o = (char)d;
- buffer.append(o);
- }
+ buffer.append(new
String(Character.toChars(d)));
buffer.append(c);
stillEscaping = false;
hexEscape = new StringBuilder();
@@ -1193,9 +1190,11 @@
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
+ zzAtBOL = true;
zzAtEOF = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = zzPushbackPos = 0;
+ yyline = yychar = yycolumn = 0;
zzLexicalState = YYINITIAL;
}
@@ -1370,9 +1369,37 @@
zzMarkedPos = zzMarkedPosL;
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
- case 14:
- { if(debug) log("Deleted unofficial ident: "+yytext());
- w.write("/* " + l10n("deletedUnofficialIdent") + " */");
+ case 24:
+ { // This is horrible. However it seems that there is no other way
to do it with either jflex or CUP, as {URL} cannot be an unambiguous token :(
+ String s = yytext();
+ if(debug) log("Recognized URL: "+s);
+
+ DecodedStringThingy dst = new DecodedStringThingy(s);
+
+ if(!dst.url) {
+ throw new IllegalStateException("parsing url().. isn't a
url()");
+ }
+ if(dst.suffix.length() > 0) {
+ yypushback(dst.suffix.length());
+ dst.suffix = "";
+ }
+
+ s = dst.data;
+ if(debug) log("URL now: "+s);
+ try {
+ s = processURL(s);
+ dst.data = s;
+ if(s == null || s.equals("")) {
+ if(debug) log("URL invalid");
+ w.write("url()");
+ } else {
+ s = dst.toString();
+ if(debug) log("Writing: "+s);
+ w.write(s);
+ }
+ } catch (CommentException e) {
+ w.write("/* "+commentEncode(e.getMessage())+" */");
+ }
}
case 33: break;
case 20:
@@ -1381,19 +1408,23 @@
if(debug) log("Matched unicode: "+s);
}
case 34: break;
- case 2:
- { String s = yytext();
- w.write(s);
- if(debug) log("Matched ident: "+s);
+ case 28:
+ { if(debug) log("Deleted unofficial ident with url: "+yytext());
+ w.write("/* " + l10n("deletedUnofficialIdentWithURL") + " */");
}
case 35: break;
- case 27:
+ case 8:
{ String s = yytext();
- s = s.substring("@media".length()).trim();
- w.write("@media "+s+" ");
- if(debug) log("Matched @media: "+s);
+ w.write(s);
+ if(debug) log("Matched close braces: "+s);
}
case 36: break;
+ case 23:
+ { String s = yytext();
+ w.write(s);
+ if(debug) log("Matched HTML comment: "+s);
+ }
+ case 37: break;
case 12:
{ String s = yytext();
if(debug) log("Matched string: "+s);
@@ -1404,98 +1435,86 @@
w.write(s);
}
}
- case 37: break;
- case 21:
- { String s = yytext();
- if(debug) log("Got hexcolor: "+s);
- w.write(s);
- }
case 38: break;
- case 7:
+ case 17:
{ String s = yytext();
- w.write(s);
- if(debug) log("Matched open braces: "+s);
+ w.write(s);
+ if(debug) log("Matched ~=: "+s);
}
case 39: break;
- case 6:
+ case 26:
{ String s = yytext();
w.write(s);
- if(debug) log("Matched semicolon: "+s);
+ if(debug) log("Matched @page: "+s);
}
case 40: break;
- case 13:
+ case 22:
{ String s = yytext();
- w.write(s);
- if(debug) log("Matched number: "+s);
+ StringBuilder sb = new StringBuilder(s.length());
+ sb.append("/* ");
+ boolean inPrefix = true;
+ for(int i=2;i<s.length()-2;i++) {
+ char c = s.charAt(i);
+ if(inPrefix && Character.isWhitespace(c)) {
+ continue;
+ }
+ inPrefix = false;
+ if(Character.isDigit(c) || Character.isWhitespace(c) ||
+ Character.isLetter(c) || c == '.' || c == '_' || c ==
'-') {
+ // No @, no !, etc; IE has been known to do things with
comments
+ // in CSS, and other browsers may too
+ sb.append(c);
+ }
+ }
+ while(Character.isWhitespace(sb.charAt(sb.length()-1)))
+ sb.deleteCharAt(sb.length()-1);
+ sb.append(" */");
+ w.write(sb.toString());
+ if(debug) log("Matched comment: "+s+" -> "+sb.toString());
}
case 41: break;
- case 26:
+ case 13:
{ String s = yytext();
w.write(s);
- if(debug) log("Matched @page: "+s);
+ if(debug) log("Matched number: "+s);
}
case 42: break;
- case 17:
+ case 6:
{ String s = yytext();
- w.write(s);
- if(debug) log("Matched ~=: "+s);
+ w.write(s);
+ if(debug) log("Matched semicolon: "+s);
}
case 43: break;
- case 23:
+ case 21:
{ String s = yytext();
+ if(debug) log("Got hexcolor: "+s);
w.write(s);
- if(debug) log("Matched HTML comment: "+s);
}
case 44: break;
- case 28:
- { if(debug) log("Deleted unofficial ident with url: "+yytext());
- w.write("/* " + l10n("deletedUnofficialIdentWithURL") + " */");
+ case 7:
+ { String s = yytext();
+ w.write(s);
+ if(debug) log("Matched open braces: "+s);
}
case 45: break;
- case 8:
+ case 27:
{ String s = yytext();
- w.write(s);
- if(debug) log("Matched close braces: "+s);
+ s = s.substring("@media".length()).trim();
+ w.write("@media "+s+" ");
+ if(debug) log("Matched @media: "+s);
}
case 46: break;
+ case 2:
+ { String s = yytext();
+ w.write(s);
+ if(debug) log("Matched ident: "+s);
+ }
+ case 47: break;
case 25:
{ String s = yytext();
w.write(s);
if(debug) log("Matched unicode range: "+s);
}
- case 47: break;
- case 24:
- { // This is horrible. However it seems that there is no other way
to do it with either jflex or CUP, as {URL} cannot be an unambiguous token :(
- String s = yytext();
- if(debug) log("Recognized URL: "+s);
-
- DecodedStringThingy dst = new DecodedStringThingy(s);
-
- if(!dst.url) {
- throw new IllegalStateException("parsing url().. isn't a
url()");
- }
- if(dst.suffix.length() > 0) {
- yypushback(dst.suffix.length());
- dst.suffix = "";
- }
-
- s = dst.data;
- if(debug) log("URL now: "+s);
- try {
- s = processURL(s);
- dst.data = s;
- if(s == null || s.equals("")) {
- if(debug) log("URL invalid");
- w.write("url()");
- } else {
- s = dst.toString();
- if(debug) log("Writing: "+s);
- w.write(s);
- }
- } catch (CommentException e) {
- w.write("/* "+commentEncode(e.getMessage())+" */");
- }
- }
case 48: break;
case 30:
{ String s = yytext();
@@ -1503,12 +1522,17 @@
if(debug) log("Matched @font-face: "+s);
}
case 49: break;
- case 5:
- { String s = yytext();
- w.write(s);
- if(debug) log("Matched function end: "+s);
+ case 14:
+ { if(debug) log("Deleted unofficial ident: "+yytext());
+ w.write("/* " + l10n("deletedUnofficialIdent") + " */");
}
case 50: break;
+ case 19:
+ { String s = yytext();
+ w.write(s);
+ if(debug) log("Matched HTML comment: "+s);
+ }
+ case 51: break;
case 29:
{ String s = yytext();
if(debug) log("Found @import: "+s);
@@ -1533,63 +1557,26 @@
w.write("/* " + commentEncode(e.getMessage()) + " */");
}
}
- case 51: break;
- case 4:
- { String s = yytext();
- w.write(s);
- if(debug) log("Matched single char: "+s);
- }
case 52: break;
- case 15:
+ case 3:
{ String s = yytext();
w.write(s);
- if(debug) log("Matched #name: "+s);
+ if(debug) log("Matched whitespace: "+s);
}
case 53: break;
- case 10:
- { if(postBadImportFlag) {
- // Ignore
- postBadImportFlag = false;
- if(debug) log("Ignoring mediums list because after bad import:
"+
- yytext());
- } else {
- String s = yytext();
- w.write(s);
- if(debug) log("Matched and passing on mediums list: "+s);
- }
+ case 1:
+ { String s = yytext();
+ char c = s.charAt(0);
+ log("Matched anything: "+yytext()+" - ignoring");
+ w.write("/* "+l10n("deletedUnmatchedChar")+" "+c+" */"); // single char
cannot break out of comment
}
case 54: break;
- case 18:
+ case 31:
{ String s = yytext();
w.write(s);
- if(debug) log("Matched |=: "+s);
+ if(debug) log("Matched important: "+s);
}
case 55: break;
- case 22:
- { String s = yytext();
- StringBuilder sb = new StringBuilder(s.length());
- sb.append("/* ");
- boolean inPrefix = true;
- for(int i=2;i<s.length()-2;i++) {
- char c = s.charAt(i);
- if(inPrefix && Character.isWhitespace(c)) {
- continue;
- }
- inPrefix = false;
- if(Character.isDigit(c) || Character.isWhitespace(c) ||
- Character.isLetter(c) || c == '.' || c == '_' || c ==
'-') {
- // No @, no !, etc; IE has been known to do things with
comments
- // in CSS, and other browsers may too
- sb.append(c);
- }
- }
- while(Character.isWhitespace(sb.charAt(sb.length()-1)))
- sb.deleteCharAt(sb.length()-1);
- sb.append(" */");
- w.write(sb.toString());
- if(debug) log("Matched comment: "+s+" -> "+sb.toString());
- }
- case 56: break;
case 16:
{ if(!deleteErrors) {
throwError(l10n("unknownAtIdentifierLabel")+" "+yytext());
@@ -1599,25 +1586,38 @@
// Ignore
}
}
- case 57: break;
- case 31:
+ case 56: break;
+ case 11:
{ String s = yytext();
w.write(s);
- if(debug) log("Matched important: "+s);
+ if(debug) log("Matched measurement: "+s);
}
- case 58: break;
- case 11:
+ case 57: break;
+ case 18:
{ String s = yytext();
w.write(s);
- if(debug) log("Matched measurement: "+s);
+ if(debug) log("Matched |=: "+s);
}
- case 59: break;
+ case 58: break;
case 32:
{ String s = yytext();
detectedCharset = s;
if(debug) log("Matched and ignoring charset: "+s);
// Ignore
}
+ case 59: break;
+ case 10:
+ { if(postBadImportFlag) {
+ // Ignore
+ postBadImportFlag = false;
+ if(debug) log("Ignoring mediums list because after bad import:
"+
+ yytext());
+ } else {
+ String s = yytext();
+ w.write(s);
+ if(debug) log("Matched and passing on mediums list: "+s);
+ }
+ }
case 60: break;
case 9:
{ String s = yytext();
@@ -1626,23 +1626,22 @@
if(debug) log("Matched function start: "+s);
}
case 61: break;
- case 1:
+ case 4:
{ String s = yytext();
- char c = s.charAt(0);
- log("Matched anything: "+yytext()+" - ignoring");
- w.write("/* "+l10n("deletedUnmatchedChar")+" "+c+" */"); // single char
cannot break out of comment
+ w.write(s);
+ if(debug) log("Matched single char: "+s);
}
case 62: break;
- case 3:
+ case 15:
{ String s = yytext();
w.write(s);
- if(debug) log("Matched whitespace: "+s);
+ if(debug) log("Matched #name: "+s);
}
case 63: break;
- case 19:
+ case 5:
{ String s = yytext();
- w.write(s);
- if(debug) log("Matched HTML comment: "+s);
+ w.write(s);
+ if(debug) log("Matched function end: "+s);
}
case 64: break;
default:
Modified:
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex
===================================================================
---
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex
2008-09-25 01:00:29 UTC (rev 22831)
+++
branches/db4o/freenet/src/freenet/clients/http/filter/CSSTokenizerFilter.jflex
2008-09-25 01:21:24 UTC (rev 22832)
@@ -11,6 +11,7 @@
// just needs somebody to go over the standard carefully and eliminate
everything that isn't sufficiently specific (e.g. matching a '-' on its own).
// Mostly from http://www.w3.org/TR/REC-CSS2/grammar.html
+ at SuppressWarnings("fallthrough")
%%
%{
@@ -96,11 +97,11 @@
quote = q;
s = s.substring(1);
} else quote = ' ';
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
int x = 0;
boolean justEscaping = false;
boolean stillEscaping = false;
- StringBuffer hexEscape = new StringBuffer();
+ StringBuilder hexEscape = new StringBuilder();
while(x < s.length()) {
char c = s.charAt(x);
x++;
@@ -124,38 +125,16 @@
// Ignore one whitespace char
after an escape
int d =
Integer.parseInt(hexEscape.toString(),
16);
- // FIXME once we can use 1.5,
use Characters.toChars(int).
- if(d > 0xFFFF) {
- String error =
-
l10n("supplementalCharsNotSupported");
- logError(error);
- try {
- w.write("/*
"+error+"*/");
- } catch (IOException e)
{};
- } else {
- c = (char)d;
- buffer.append(c);
- }
+ buffer.append(new
String(Character.toChars(d)));
stillEscaping = false;
- hexEscape = new StringBuffer();
+ hexEscape = new StringBuilder();
} else {
int d =
Integer.parseInt(hexEscape.toString(),
16);
- // FIXME once we can use 1.5,
use Characters.toChars(int).
- if(d > 0xFFFF) {
- String error =
-
l10n("supplementalCharsNotSupported");
- logError(error);
- try {
- w.write("/*
"+error+"*/");
- } catch (IOException e)
{};
- } else {
- char o = (char)d;
- buffer.append(o);
- }
+ buffer.append(new
String(Character.toChars(d)));
buffer.append(c);
stillEscaping = false;
- hexEscape = new StringBuffer();
+ hexEscape = new StringBuilder();
}
} else {
if(quote != ' ' && c == quote) {
@@ -178,8 +157,9 @@
suffix = "";
}
+ @Override
public String toString() {
- StringBuffer out = new StringBuffer();
+ StringBuilder out = new StringBuilder();
if(url) out.append("url(");
if(quote != ' ') out.append(quote);
out.append(unescapeData());
@@ -190,7 +170,7 @@
}
public String unescapeData() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for(int i=0;i<data.length();i++) {
char c = data.charAt(i);
if(c == quote || c == '\n') {
@@ -203,7 +183,7 @@
}
String commentEncode(String s) {
- StringBuffer sb = new StringBuffer(s.length());
+ StringBuilder sb = new StringBuilder(s.length());
for(int i=0;i<s.length();i++) {
char c = s.charAt(i);
if(c == '/')
@@ -344,7 +324,7 @@
//"/*"([^*]|[\r\n]|("*"+([^*/]|[\r\n])))*"*"*"/" {
"/*" ~"*/" {
String s = yytext();
- StringBuffer sb = new StringBuffer(s.length());
+ StringBuilder sb = new StringBuilder(s.length());
sb.append("/* ");
boolean inPrefix = true;
for(int i=2;i<s.length()-2;i++) {
Modified:
branches/db4o/freenet/src/freenet/clients/http/filter/ContentDataFilter.java
===================================================================
---
branches/db4o/freenet/src/freenet/clients/http/filter/ContentDataFilter.java
2008-09-25 01:00:29 UTC (rev 22831)
+++
branches/db4o/freenet/src/freenet/clients/http/filter/ContentDataFilter.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -14,7 +14,9 @@
*/
public interface ContentDataFilter {
- public Bucket readFilter(Bucket data, BucketFactory bf, String charset,
HashMap otherParams, FilterCallback cb) throws DataFilterException, IOException;
+ public Bucket readFilter(Bucket data, BucketFactory bf, String charset,
HashMap<String, String> otherParams,
+ FilterCallback cb) throws DataFilterException, IOException;
- public Bucket writeFilter(Bucket data, BucketFactory bf, String
charset, HashMap otherParams, FilterCallback cb) throws DataFilterException,
IOException;
+ public Bucket writeFilter(Bucket data, BucketFactory bf, String
charset, HashMap<String, String> otherParams,
+ FilterCallback cb) throws DataFilterException, IOException;
}
Modified: branches/db4o/freenet/src/freenet/clients/http/filter/GIFFilter.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/filter/GIFFilter.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/filter/GIFFilter.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -17,8 +17,8 @@
import freenet.support.io.Closer;
/**
- * Content filter for PNG's.
- * This one just verifies that a PNG is valid, and throws if it isn't.
+ * Content filter for GIF's.
+ * This one just verifies that a GIF is valid, and throws if it isn't.
*/
public class GIFFilter implements ContentDataFilter {
Modified: branches/db4o/freenet/src/freenet/clients/http/filter/HTMLFilter.java
===================================================================
--- branches/db4o/freenet/src/freenet/clients/http/filter/HTMLFilter.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/clients/http/filter/HTMLFilter.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -17,13 +17,13 @@
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.nio.charset.MalformedInputException;
-import java.util.Enumeration;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Hashtable;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.StringTokenizer;
-import java.util.Vector;
import freenet.l10n.L10n;
import freenet.support.HTMLDecoder;
@@ -43,7 +43,8 @@
private static boolean deleteWierdStuff = true;
private static boolean deleteErrors = true;
- public Bucket readFilter(Bucket bucket, BucketFactory bf, String
charset, HashMap otherParams, FilterCallback cb) throws DataFilterException,
IOException {
+ public Bucket readFilter(Bucket bucket, BucketFactory bf, String
charset, HashMap<String, String> otherParams,
+ FilterCallback cb) throws DataFilterException, IOException {
logMINOR = Logger.shouldLog(Logger.MINOR, this);
logDEBUG = Logger.shouldLog(Logger.DEBUG, this);
if(logMINOR) Logger.minor(this, "readFilter():
charset="+charset);
@@ -76,7 +77,8 @@
return temp;
}
- public Bucket writeFilter(Bucket bucket, BucketFactory bf, String
charset, HashMap otherParams, FilterCallback cb) throws DataFilterException,
IOException {
+ public Bucket writeFilter(Bucket bucket, BucketFactory bf, String
charset, HashMap<String, String> otherParams,
+ FilterCallback cb) throws DataFilterException, IOException {
throw new UnsupportedOperationException();
}
@@ -150,7 +152,7 @@
*/
StringBuilder b = new StringBuilder(100);
StringBuilder balt = new StringBuilder(4000);
- Vector splitTag = new Vector();
+ List<String> splitTag = new ArrayList<String>();
String currentTag = null;
char pprevC = 0;
char prevC = 0;
@@ -218,7 +220,7 @@
splitTag.add(b.toString());
b.setLength(0);
processTag(splitTag, w, this);
- currentTag =
(String)splitTag.get(0);
+ currentTag =
splitTag.get(0);
splitTag.clear();
balt.setLength(0);
mode = INTEXT;
@@ -314,7 +316,7 @@
if (!killTag)
processTag(splitTag, w, this);
killTag = false;
- currentTag =
(String)splitTag.get(0);
+ currentTag =
splitTag.get(0);
splitTag.clear();
b.setLength(0);
balt.setLength(0);
@@ -402,7 +404,7 @@
w.write(sout);
}
- void processTag(Vector splitTag, Writer w, HTMLParseContext pc)
+ void processTag(List<String> splitTag, Writer w, HTMLParseContext pc)
throws IOException, DataFilterException {
// First, check that it is a recognized tag
if(logDEBUG) {
@@ -498,7 +500,7 @@
this.endSlash = t.endSlash;
}
- public ParsedTag(Vector v) {
+ public ParsedTag(List<String> v) {
int len = v.size();
if (len == 0) {
element = null;
@@ -506,26 +508,26 @@
startSlash = endSlash = false;
return;
}
- String s = (String) v.elementAt(len - 1);
+ String s = v.get(len - 1);
if (((len - 1 != 0) || (s.length() > 1)) &&
s.endsWith("/")) {
s = s.substring(0, s.length() - 1);
- v.setElementAt(s, len - 1);
+ v.set(len - 1, s);
if (s.length() == 0)
len--;
endSlash = true;
// Don't need to set it back because everything
is an I-value
} else endSlash = false;
- s = (String) v.elementAt(0);
+ s = v.get(0);
if ((s.length() > 1) && s.startsWith("/")) {
s = s.substring(1);
- v.setElementAt(s, 0);
+ v.set(0, s);
startSlash = true;
} else startSlash = false;
- element = (String) v.elementAt(0);
+ element = v.get(0);
if (len > 1) {
unparsedAttrs = new String[len - 1];
for (int x = 1; x < len; x++)
- unparsedAttrs[x - 1] = (String)
v.elementAt(x);
+ unparsedAttrs[x - 1] = v.get(x);
} else
unparsedAttrs = new String[0];
if(logDEBUG) Logger.debug(this, "Element = "+element);
@@ -533,7 +535,7 @@
public ParsedTag sanitize(HTMLParseContext pc) throws
DataFilterException {
TagVerifier tv =
- (TagVerifier)
allowedTagsVerifiers.get(element.toLowerCase());
+ allowedTagsVerifiers.get(element.toLowerCase());
if(logDEBUG) Logger.debug(this, "Got verifier: "+tv+"
for "+element);
if (tv == null) {
if (deleteWierdStuff) {
@@ -575,7 +577,7 @@
}
}
- static final Hashtable allowedTagsVerifiers = new Hashtable();
+ static final Map<String, TagVerifier> allowedTagsVerifiers = new
HashMap<String, TagVerifier>();
static final String[] emptyStringArray = new String[0];
static {
@@ -1130,9 +1132,9 @@
static class TagVerifier {
final String tag;
- final HashSet allowedAttrs;
- final HashSet uriAttrs;
- final HashSet inlineURIAttrs;
+ final HashSet<String> allowedAttrs;
+ final HashSet<String> uriAttrs;
+ final HashSet<String> inlineURIAttrs;
TagVerifier(String tag, String[] allowedAttrs) {
this(tag, allowedAttrs, null, null);
@@ -1140,17 +1142,17 @@
TagVerifier(String tag, String[] allowedAttrs, String[]
uriAttrs, String[] inlineURIAttrs) {
this.tag = tag;
- this.allowedAttrs = new HashSet();
+ this.allowedAttrs = new HashSet<String>();
if (allowedAttrs != null) {
for (int x = 0; x < allowedAttrs.length; x++)
this.allowedAttrs.add(allowedAttrs[x]);
}
- this.uriAttrs = new HashSet();
+ this.uriAttrs = new HashSet<String>();
if (uriAttrs != null) {
for (int x = 0; x < uriAttrs.length; x++)
this.uriAttrs.add(uriAttrs[x]);
}
- this.inlineURIAttrs = new HashSet();
+ this.inlineURIAttrs = new HashSet<String>();
if (inlineURIAttrs != null) {
for (int x = 0; x < inlineURIAttrs.length; x++)
this.inlineURIAttrs.add(inlineURIAttrs[x]);
@@ -1158,7 +1160,7 @@
}
ParsedTag sanitize(ParsedTag t, HTMLParseContext pc) throws
DataFilterException {
- Hashtable h = new Hashtable();
+ Map<String, Object> h = new HashMap<String, Object>();
boolean equals = false;
String prevX = "";
if (t.unparsedAttrs != null)
@@ -1208,9 +1210,9 @@
return new ParsedTag(t, null);
String[] outAttrs = new String[h.size()];
int i = 0;
- for (Enumeration e = h.keys(); e.hasMoreElements();) {
- String x = (String) e.nextElement();
- Object o = h.get(x);
+ for (Map.Entry<String, Object> entry : h.entrySet()) {
+ String x = entry.getKey();
+ Object o = entry.getValue();
String y;
if (o instanceof String)
y = (String) o;
@@ -1224,14 +1226,13 @@
return new ParsedTag(t, outAttrs);
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = new Hashtable();
- for (Enumeration e = h.keys(); e.hasMoreElements();) {
- String x = (String) e.nextElement();
- Object o = h.get(x);
+ Map<String, Object> hn = new HashMap<String, Object>();
+ for (Map.Entry<String, Object> entry : h.entrySet()) {
+ String x = entry.getKey();
+ Object o = entry.getValue();
// Straight attribs
if (allowedAttrs.contains(x)) {
hn.put(x, o);
@@ -1319,12 +1320,10 @@
abstract void processStyle(HTMLParseContext pc);
- @Override
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
if (p.startSlash) {
return finish(h, hn, pc);
} else {
@@ -1332,9 +1331,7 @@
}
}
- Hashtable finish(
- Hashtable h,
- Hashtable hn,
+ Map<String, Object> finish(Map<String, Object> h, Map<String,
Object> hn,
HTMLParseContext pc) throws DataFilterException {
if(logDEBUG) Logger.debug(this, "Finishing
script/style");
// Finishing
@@ -1360,7 +1357,8 @@
return hn;
}
- Hashtable start(Hashtable h, Hashtable hn, HTMLParseContext pc)
throws DataFilterException {
+ Map<String, Object> start(Map<String, Object> h, Map<String,
Object> hn, HTMLParseContext pc)
+ throws DataFilterException {
if(logDEBUG) Logger.debug(this, "Starting
script/style");
pc.styleScriptRecurseCount++;
if (pc.styleScriptRecurseCount > 1) {
@@ -1430,10 +1428,8 @@
*/
}
- Hashtable sanitizeHash(
- Hashtable hn,
- ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ Map<String, Object> sanitizeHash(Map<String, Object> hn,
ParsedTag p, HTMLParseContext pc)
+ throws DataFilterException {
// Call parent so we swallow the scripting
super.sanitizeHash(hn, p, pc);
return null; // Lose the tags
@@ -1462,11 +1458,10 @@
super(tag, allowedAttrs, uriAttrs, inlineURIAttrs);
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
// %i18n dealt with by TagVerifier
// %coreattrs
String id = getHashString(h, "id");
@@ -1498,7 +1493,7 @@
}
static class CoreTagVerifier extends BaseCoreTagVerifier {
- final HashSet eventAttrs;
+ final HashSet<String> eventAttrs;
static final String[] stdEvents =
new String[] {
"onclick",
@@ -1543,7 +1538,7 @@
String[] eventAttrs,
boolean addStdEvents) {
super(tag, allowedAttrs, uriAttrs, inlineURIAttrs);
- this.eventAttrs = new HashSet();
+ this.eventAttrs = new HashSet<String>();
if (eventAttrs != null) {
for (int x = 0; x < eventAttrs.length; x++)
this.eventAttrs.add(eventAttrs[x]);
@@ -1554,14 +1549,13 @@
}
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
// events (default and added)
- for (Iterator e = eventAttrs.iterator(); e.hasNext();) {
- String name = (String) e.next();
+ for (Iterator<String> e = eventAttrs.iterator();
e.hasNext();) {
+ String name = e.next();
String arg = getHashString(h, name);
if (arg != null) {
arg = sanitizeScripting(arg);
@@ -1584,11 +1578,10 @@
super(tag, allowedAttrs, uriAttrs, inlineURIAttrs,
eventAttrs);
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
String hreflang = getHashString(h, "hreflang");
String charset = null;
String type = getHashString(h, "type");
@@ -1665,11 +1658,10 @@
super(tag, allowedAttrs, uriAttrs, null, eventAttrs);
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
if(p.startSlash) {
// Allow, but only with standard elements
return hn;
@@ -1694,7 +1686,7 @@
}
static class InputTagVerifier extends CoreTagVerifier{
- final HashSet allowedTypes;
+ final HashSet<String> allowedTypes;
String[] types = new String[]{
"text",
"password",
@@ -1715,18 +1707,17 @@
String[] inlineURIAttrs,
String[] eventAttrs) {
super(tag, allowedAttrs, uriAttrs, inlineURIAttrs,
eventAttrs);
- this.allowedTypes = new HashSet();
+ this.allowedTypes = new HashSet<String>();
if (types != null) {
for (int x = 0; x < types.length; x++)
this.allowedTypes.add(types[x]);
}
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
// We drop the whole <input> if type isn't allowed
if(!allowedTypes.contains(hn.get("type"))){
@@ -1742,11 +1733,10 @@
super("meta", new String[] { "id" });
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
/*
* Several possibilities: a) meta http-equiv=X
content=Y b) meta
* name=X content=Y
@@ -1826,7 +1816,7 @@
super(tag, null);
}
- static final Hashtable DTDs = new Hashtable();
+ static final Map<String, Object> DTDs = new HashMap<String,
Object>();
static {
DTDs.put(
@@ -1897,11 +1887,10 @@
super("html", new String[] { "id", "version" });
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException {
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
String xmlns = getHashString(h, "xmlns");
if ((xmlns != null) &&
xmlns.equals("http://www.w3.org/1999/xhtml"))
hn.put("xmlns", xmlns);
@@ -1915,11 +1904,10 @@
super(string, strings, strings2, null);
}
- Hashtable sanitizeHash(
- Hashtable h,
+ Map<String, Object> sanitizeHash(Map<String, Object> h,
ParsedTag p,
HTMLParseContext pc) throws DataFilterException
{
- Hashtable hn = super.sanitizeHash(h, p, pc);
+ Map<String, Object> hn = super.sanitizeHash(h, p, pc);
// Get the already-sanitized version.
String baseHref = getHashString(hn, "href");
if(baseHref != null) {
@@ -2075,7 +2063,7 @@
return cb.processURI(suri, overrideType, false, inline);
}
- static String getHashString(Hashtable h, String key) {
+ static String getHashString(Map<String, Object> h, String key) {
Object o = h.get(key);
if (o == null)
return null;
Modified: branches/db4o/freenet/src/freenet/crypt/DiffieHellman.java
===================================================================
--- branches/db4o/freenet/src/freenet/crypt/DiffieHellman.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/crypt/DiffieHellman.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -87,7 +87,7 @@
precalcThread.start();
}
- /** Will ask the precalc thread to refill the buffer if neccessary */
+ /** Will ask the precalc thread to refill the buffer if necessary */
private static void askRefill() {
// If the buffer size is below the threshold then wake the
precalc
// thread
Modified: branches/db4o/freenet/src/freenet/l10n/freenet.l10n.de.properties
===================================================================
--- branches/db4o/freenet/src/freenet/l10n/freenet.l10n.de.properties
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/l10n/freenet.l10n.de.properties
2008-09-25 01:21:24 UTC (rev 22832)
@@ -492,7 +492,7 @@
IPDetectorPluginManager.directTitle=Direkte Internet-Verbindung erkannt
IPDetectorPluginManager.forwardPort=Ihr Knoten scheint sich hinter einem
NAT-Ger?t zu befinden (f?r Details schauen Sie auf die Erreichbarkeits-Seite).
Sie sollten, wenn m?glich, den UDP-Port (nicht TCP) ${port} weiterleiten um die
Erreichbarkeit zu verbessern. Es ist m?glich, dass Sie dies bereits getan
haben; Freenet braucht etwas Zeit um eine Portweiterleitung zu erkennen. F?r
weitere Informationen schauen Sie ${link}hier${/link}.
IPDetectorPluginManager.forwardPortMaybeForwarded=Ihr Knoten scheint sich
hinter einem NAT-Ger?t zu befinden (Details finden Sie auf der
Erreichbarkeits-Seite). Sie sollten, wenn m?glich, den UDP-Port (nicht TCP)
${port} weiterleiten um die Erreichbarkeit zu verbessern. Es ist m?glich, dass
Sie dies bereits getan haben; Freenet braucht etwas Zeit um eine
Portweiterleitung zu erkennen. Weitere Informationen finden Sie
${link}hier${/link}.
-IPDetectorPluginManager.forwardPortNotForwarded=Ihr Knoten scheint sich hinter
einem NAT-Ger?t zu befinden (Details finden Sie auf der Erreichbarkeits-Seite).
Sie sollten, wenn m?glich, den UDP-Port (nicht TCP) ${port} weiterleiten um die
Erreichbarkeit zu verbessern. Es scheint, als ob der Port nicht weitergeleitet
wird, Freenet kann dies jedoch nicht sicher erkennen. Weitere Informationen
finden Sie ${link}hier${/link}.
+IPDetectorPluginManager.forwardPortNotForwarded=Ihr Knoten scheint sich hinter
einem NAT-Ger?t zu befinden (Details finden Sie auf der Erreichbarkeits-Seite).
Sie sollten, wenn m?glich, den UDP-Port (nicht TCP) ${port} weiterleiten um die
Erreichbarkeit zu verbessern. Es scheint, als ob der Port nicht weitergeleitet
wird, Freenet kann dies jedoch nicht sicher erkennen. Weitere Informationen
finden Sie ${link}hier${/link}. Es kann bis zu 24 Stunden dauern, bis Freenet
erkennt, dass sie die Ports erfolgreich weitergeleitet haben.
IPDetectorPluginManager.forwardPortShort=Bitte leiten Sie den UDP-Port ${port}
weiter.
IPDetectorPluginManager.forwardPortShortMaybeForwarded=Bitte leiten Sie den
UDP-Port ${port} weiter (vielleicht haben Sie dies schon getan).
IPDetectorPluginManager.forwardPortShortNotForwarded=Bitte leiten Sie den
UDP-Port ${port} weiter (er scheint noch nicht weitergeleitet zu sein).
@@ -716,7 +716,7 @@
Node.storeSize=Speicher-Gr??e in Bytes
Node.storeSizeLong=Gr??e des Speichers in Bytes.
Node.storeType=Art der Speicherung (?NDERN SIE DIES NICHT)
-Node.storeTypeLong=Art der Datenspeicherung. Aktuell k?nnen dies bdb-index
(benutzt BerkeleyDBFreenetStore um den Index zu speichern und speichert die
Daten in Dateien auf der Festplatte) oder ram (speichert Index und Daten im
RAM) sein. Benutzen Sie ram nur dann, wenn Sie wissen, was sie tun und genug
RAM zur Verf?gung haben um all ihre Daten zu speichern (und beachten Sie dass
diese beim Beenden nicht gespeichert werden)!
+Node.storeTypeLong=Art der Datenspeicherung. Aktuell k?nnen dies salt-hash (
benutzt ein Salted on-disk Hashtable mit Bloom-Filter), bdb-index (benutzt
BerkeleyDBFreenetStore um den Index zu speichern und speichert die Daten in
Dateien auf der Festplatte) oder ram (speichert Index und Daten im RAM) sein.
Benutzen Sie ram nur dann, wenn Sie wissen, was sie tun und genug RAM zur
Verf?gung haben um all ihre Daten zu speichern (und beachten Sie dass diese
beim Beenden nicht gespeichert werden)! ?nderungen werden erst nach einem
Neustart von Freenet wirksam.
Node.swapRInterval=Tausch-Anfragen-Sende-Intervall (ms)
Node.swapRIntervalLong=Intervall in dem Tausch-Anfragen gesendet werden in
Millisekunden. Lassen Sie dies in Ruhe!
Node.throttleLocalTraffic=Lokalen Datenverkehr drosseln?
@@ -1063,7 +1063,7 @@
SecurityLevels.maxSecurityYouNeedFriends=${bold}Sie m?ssen mindestens eine
Person kennen, die Freenet schon benutzt, ${/bold}, besser 3 Personen, 5-10 f?r
eine gute Geschwindigkeit. Sie k?nnen sie auf der Freunde-Seite hinzuf?gen. Es
sollten aber Menschen sein, die sie kennen und denen sie zumindest etwas trauen.
SecurityLevels.maximumNetworkThreatLevelCheckbox=Ja, ich will wirklich die
maximale Sicherheit aktivieren. Ich verstehe, dass Freenet immer noch
experimentelle Software ist und dass es immer noch m?glich sein kann, meine
Spuren zu verfolgen. Ich verstehe auch, dass diese Einstellung die
Geschwindigkeit von Freenet stark verringern kann.
SecurityLevels.maximumNetworkThreatLevelWarning=${bold}WARNUNG:${/bold} Sie
sind dabei, das Netzwerk Sicherheitslevel auf maximum zu setzen! Dies wird die
Geschwindigkeit von Freenet ${bold}deutlich${/bold} verringern! Bitte machen
sie dies nur, wenn sie die zus?tzliche Sicherheit wirklich ben?tigen.
-SecurityLevels.networkThreatLevel=Wie viel Schutz ben?tigen sie gegen Internet
Provider, Firmen, Regierungen, gelangweilten Kindern usw, welche versuchen,
ihre Aktivit?ten in Freenet zu verfolgen?
+SecurityLevels.networkThreatLevel=Wie viel Schutz ben?tigen sie gegen Internet
Provider, Firmen, Regierungen, gelangweilte Kindern usw., welche versuchen,
ihre Aktivit?ten in Freenet zu verfolgen?
SecurityLevels.networkThreatLevelConfirmTitle=WARNUNG: Setze das Netzwerk
Sicherheitslevel auf ${mode}
SecurityLevels.networkThreatLevelLowCheckbox=Ich bin mir sicher, ich m?chte
mehr Geschwindigkeit und ich f?rchte mich nicht davor, was andere ?ber meine
Aktivit?ten in Freenet erfahren.
SecurityLevels.networkThreatLevelLowWarning=Sie sind dabei, das Netzwerk
Sicherheitslevel auf niedrig zu setzen. Dies bedeutet, es wird f?r Fremde
einfach sein, ihre Anonymit?t ?ber das Internet anzugreifen. Sind sie sicher?
@@ -1084,7 +1084,7 @@
SecurityLevels.friendsThreatLevel.choice.HIGH=Ich m?chte, dass Freenet
besondere Schutzma?nahmen gegen Angriffe meiner Freunde ergreift.
SecurityLevels.friendsThreatLevel.choice.LOW=Ich bin nicht besorgt ?ber
Angriffe von meinen Freunden. Ich vertraue ihnen und ihren F?higkeiten
bez?glich Computersicherheit.
SecurityLevels.friendsThreatLevel.choice.NORMAL=Ich bin nicht besonders
besorgt ?ber Angriffe von Freunden, aber ich m?chte, dass Freenet ein gesundes
Ma? an Vorsicht walten l?sst.
-SecurityLevels.friendsThreatLevel.desc.HIGH=Freenet wird das teilen von
Informationen mit ihren Freunden vermeiden und wird deshalb etwas langsamer
sein als im Modus NORMAL.
+SecurityLevels.friendsThreatLevel.desc.HIGH=Freenet wird das Teilen von
Informationen mit ihren Freunden vermeiden und wird deshalb etwas langsamer
sein als im Modus NORMAL.
SecurityLevels.friendsThreatLevel.desc.LOW=Freenet wird viele Informationen
mit den Knoten ihrer Freunde teilen, um die bestm?gliche Geschwindigkeit zu
erreichen.
SecurityLevels.friendsThreatLevel.desc.NORMAL=Freenet wird eine beschr?nkte
Menge an Informationen mit ihren Freunden teilen und wird langsamer sein als im
Modus NIEDRIG.
SecurityLevels.friendsThreatLevel.name.HIGH=HOCH
@@ -1092,7 +1092,7 @@
SecurityLevels.friendsThreatLevel.name.NORMAL=NORMAL
SecurityLevels.networkThreatLevel.choice.HIGH=Ich m?chte es f?r andere
deutlich schwerer machen, meine Kommunikation zu beobachten oder ich bef?rchte,
dass mein Provider versuchen k?nnte, Freenet zu blockieren.
SecurityLevels.networkThreatLevel.choice.LOW=Ich mache mir keine Gedanken ?ber
?berwachung und will maximale Geschwindigkeit.
-SecurityLevels.networkThreatLevel.choice.MAXIMUM=Ich plane, auf Informationen
zuzugreifen, die dazu f?hren k?nnen, dass ich verhaftet oder gefangen genommen
werde oder schlimmeres. Ich verstehe, dass Freenet experimentell ist und keine
Sicherheit gegen bestimmte (bekannte) Angriffe bieten kann. Aber ich akzeptiere
die Risiken verglichen mit den Alternativen.
+SecurityLevels.networkThreatLevel.choice.MAXIMUM=Ich plane, auf Informationen
zuzugreifen, die dazu f?hren k?nnen, dass ich verhaftet, gefangen genommen
werde oder schlimmeres. Ich verstehe, dass Freenet experimentell ist und keine
Sicherheit gegen bestimmte (bekannte) Angriffe bieten kann. Aber ich akzeptiere
die Risiken verglichen mit den Alternativen.
SecurityLevels.networkThreatLevel.choice.NORMAL=Ich lebe in einem relativ
freien Land, aber ich m?chte es Anderen schwerer machen, meine Kommunikation zu
?berwachen.
SecurityLevels.networkThreatLevel.desc.HIGH=Freenet wird sich nur zu ihren
Freunden verbinden, also ${bold}m?ssen sie Freunde haben, die bereits Freenet
benutzen, wenn sie diesen Modus ausw?hlen${/bold}. Freenet wird langsam sein,
wenn sie nicht mindestens 5-10 Freunde hinzuf?gen und wird gar nicht
funktionieren, wenn nicht mindestens eine Verbindung zu einem Freund besteht.
SecurityLevels.networkThreatLevel.desc.LOW=Es kann ziemlich einfach f?r Andere
sein, ihre Identit?t herauszufinden!
@@ -1104,8 +1104,8 @@
SecurityLevels.networkThreatLevel.name.NORMAL=NORMAL
SecurityLevels.physicalThreatLevel.choice.LOW=Ich bin nicht besorgt.
SecurityLevels.physicalThreatLevel.choice.NORMAL=Ich bin besorgt.
-SecurityLevels.physicalThreatLevel.desc.LOW=Freenet wird ein verschl?sseln der
Daten auf der Festplatte vermeiden und wird Spuren ihrer Aktivit?ten auf ihrer
Festplatte hinterlassen. Erh?ht die Geschwindigkeit auf Kosten der Sicherheit,
wenn ihr Computer beschlagnahmt wird.
-SecurityLevels.physicalThreatLevel.desc.NORMAL=Freenet wird temor?re Dateien
usw verschl?ssen (mit der Folge einer etwas geringeren Geschwindigkeit).
Allerdings sollten sie zus?tzliche Vorsichtsma?nahmen wie das deaktivieren
ihres Browsercaches ergreifen, wenn sie das Webinterface benutzen. Wenn sie
best?ndige Downloads nutzen (die meisten Programme machen dies), sollten sie
die Festplatte verschl?sseln, auf der Freenet l?uft.
+SecurityLevels.physicalThreatLevel.desc.LOW=Freenet wird ein Verschl?sseln der
Daten auf der Festplatte vermeiden und wird Spuren ihrer Aktivit?ten auf ihrer
Festplatte hinterlassen. Erh?ht die Geschwindigkeit auf Kosten der Sicherheit,
wenn ihr Computer beschlagnahmt wird.
+SecurityLevels.physicalThreatLevel.desc.NORMAL=Freenet wird temor?re Dateien
usw. verschl?ssen (mit der Folge einer etwas geringeren Geschwindigkeit).
Allerdings sollten sie zus?tzliche Vorsichtsma?nahmen wie das Deaktivieren
ihres Browsercaches ergreifen, wenn sie das Webinterface benutzen. Wenn sie
best?ndige Downloads nutzen (die meisten Programme machen dies), sollten sie
die Festplatte verschl?sseln, auf der Freenet l?uft.
SecurityLevels.physicalThreatLevel.name.LOW=NIEDRIG
SecurityLevels.physicalThreatLevel.name.NORMAL=NORMAL
ShortOption.parseError=Kann den Wert nicht als String-Array
(Zeichenfolgen-Feld) erkennen: ${error}
@@ -1308,7 +1308,7 @@
UserAlertManager.warningCountLabel=Warnungen:
UserAlertsToadlet.titleWithName=Warnungen f?r ${name}
WelcomeToadlet.activityTitle=Derzeitige Aktivit?t
-WelcomeToadlet.alertsSummary=Zusammenfassung der Warnungen
+WelcomeToadlet.alertsSummary=Zusammenfassung der Warnungen (klicken sie f?r
Details oder um etwas zu ?ndern)
WelcomeToadlet.arkFetchCount=ARK-Abrufer: ${total}
WelcomeToadlet.confirmAddBookmarkSubTitle=Hinzuf?gen des Lesezeichens
best?tigen
WelcomeToadlet.confirmAddBookmarkTitle=Ein Lesezeichen hinzuf?gen
Modified: branches/db4o/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- branches/db4o/freenet/src/freenet/l10n/freenet.l10n.en.properties
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/l10n/freenet.l10n.en.properties
2008-09-25 01:21:24 UTC (rev 22832)
@@ -117,9 +117,9 @@
ConfigurablePersister.doesNotExistCannotCreate=File does not exist and cannot
be created
ConfigurablePersister.existsCannotReadWrite=File exists and cannot read/write
it
ConnectivityToadlet.byIPTitle=Packets for ${ip} by IP address - ${status}
(minimum tunnel lifetime ${tunnelLength})
-ConnectivityToadlet.title=Internet connectivity for ${nodeName}
-ConnectivityToadlet.connectivity=Internet Connectivity
-ConnectivityToadlet.connectivityTitle=Connectivity
+ConnectivityToadlet.title=Internet connection status for ${nodeName}
+ConnectivityToadlet.connectivity=Internet Connection
+ConnectivityToadlet.connectivityTitle=Internet connection
ConnectivityToadlet.firstSendLeadTime=Startup to first send
ConnectivityToadlet.firstReceiveLeadTime=Online to first receive
ConnectivityToadlet.localRemoteTitle=Local/remote
@@ -305,8 +305,8 @@
FirstTimeWizardToadlet.tenPercentDisk=(= 10% of free disk space)
FirstTimeWizardToadlet.fivePercentDisk=(= 5% of free disk space)
FProxyToadlet.abortToHomepage=Abort and return to the FProxy home page
-FProxyToadlet.alertsTitle=Alerts
-FProxyToadlet.alerts=detailed status messages
+FProxyToadlet.alertsTitle=Messages
+FProxyToadlet.alerts=detailed status messages and messages from your Friends
FProxyToadlet.backToFProxy=${link}Click here${/link} to go to the FProxy home
page.
FProxyToadlet.backToReferrer=${link}Click here${/link} to go back to the
referring page.
FProxyToadlet.cantBindPort=Can't bind fproxy on that port!
@@ -326,7 +326,7 @@
FProxyToadlet.fileInformationTitle=File Information
FProxyToadlet.filenameLabel=Filename:
FProxyToadlet.friends=manage f2f connections
-FProxyToadlet.friendsTitle=Friends
+FProxyToadlet.friendsTitle=Connections to friends
FProxyToadlet.goBack=Go back
FProxyToadlet.goBackToPrev=Go back to the previous page
FProxyToadlet.invalidKeyTitle=Invalid Key
@@ -346,7 +346,7 @@
FProxyToadlet.openRSSAsRSS=${link}Click here${/link} to open the file as RSS
(this ${bold}is dangerous${/bold} if the site author is malicious as Freenet
does not know how to filter RSS yet).
FProxyToadlet.openRSSForce=${link}Click here${/link} to open the file as
${mime} (this ${bold}may be dangerous${/bold} on IE7 or FF2).
FProxyToadlet.opennet=manage untrusted connections
-FProxyToadlet.opennetTitle=Strangers
+FProxyToadlet.opennetTitle=Connections to strangers
FProxyToadlet.openWithKeyExplorer=${link}Click here${/link} to open the
freenet uri with key explorer.
FProxyToadlet.options=Your options are:
FProxyToadlet.pathNotFound=The specified path does not exist.
@@ -354,7 +354,7 @@
FProxyToadlet.plugins=configure and manage plugins
FProxyToadlet.pluginsTitle=Plugins
FProxyToadlet.queue=manage queued requests
-FProxyToadlet.queueTitle=Queue
+FProxyToadlet.queueTitle=Downloads and uploads
FProxyToadlet.retryNow=Retry now
FProxyToadlet.sizeLabel=Size:
FProxyToadlet.sizeUnknown=Size: unknown
@@ -713,9 +713,9 @@
Node.storeSize=Store size in bytes
Node.storeSizeLong=Store size in bytes
Node.storeType=Store type (LEAVE THIS ALONE)
-Node.storeTypeLong=Datastore type. Currently this can be salt-hash (use a
salted on-disk hashtable with bloom filter), bdb-index (use a
BerkeleyDBFreenetStore to store the index, and keep the data in files on disk),
or ram (keep the index and the data in RAM). Only use ram if you know what you
are doing and have enough RAM to store all your data (and note it will not be
saved on shutdown)! Changes will not take effect until Freenet has been
restarted.
+Node.storeTypeLong=Datastore type. Currently this can be salt-hash
(EXPERIMENTIAL, use a salted on-disk hashtable with bloom filter), bdb-index
(STABLE, use a BerkeleyDBFreenetStore to store the index, and keep the data in
files on disk), or ram (FOR TESTING ONLY, keep the index and the data in RAM).
Only use ram if you know what you are doing and have enough RAM to store all
your data (and note it will not be saved on shutdown)! Changes will not take
effect until Freenet has been restarted.
Node.storeBloomFilterSize=Bloom filter size (total) in bytes
-Node.storeBloomFilterSizeLong=Bloom filter size (total) in bytes. Usually
1/2048th the size of data store is more than enough. Set this to zero to
disable bloom filter.
+Node.storeBloomFilterSizeLong=Bloom filter size (total) in bytes. Usually
1/2048th the size of data store is more than enough. Set this to zero to
disable bloom filter. Set this to -1 to reset to default.
Node.storeBloomFilterCounting=Use counting bloom filter?
Node.storeBloomFilterCountingLong=Use 2-bit counting bloom filter? (don't
touch this unless you know what you are doing)
Node.swapRInterval=Swap request send interval (ms)
@@ -1314,10 +1314,10 @@
UserAlertManager.minorCountLabel=Minor:
UserAlertManager.totalLabel=Total:
UserAlertManager.warningCountLabel=Warnings:
-UserAlertsToadlet.titleWithName=Status alerts for ${name}
+UserAlertsToadlet.titleWithName=Status messages for ${name}
WelcomeToadlet.activityTitle=Current Activity
WelcomeToadlet.arkFetchCount=ARK Fetchers: ${total}
-WelcomeToadlet.alertsSummary=Status alerts summary (click for details or to
change something)
+WelcomeToadlet.alertsSummary=Status messages summary (click for details or to
change something)
WelcomeToadlet.confirmAddBookmarkSubTitle=Confirm Bookmark Addition
WelcomeToadlet.confirmAddBookmarkTitle=Add a Bookmark
WelcomeToadlet.confirmAddBookmarkWithKey=Please confirm that you want to add
the key ${key} to your bookmarks and enter the description that you would
prefer:
Modified: branches/db4o/freenet/src/freenet/l10n/freenet.l10n.es.properties
===================================================================
--- branches/db4o/freenet/src/freenet/l10n/freenet.l10n.es.properties
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/l10n/freenet.l10n.es.properties
2008-09-25 01:21:24 UTC (rev 22832)
@@ -1,3 +1,10 @@
+Announcer.announceAlertIntro=El nodo de Freenet se esta conectando a la red,
esto puede demorar unos minutos. La eficiencia de la red comenzara a mejoar en
las proximas horas, para evitar este peque?a perdida de performance que ocurre
cada vez que reiniciamos el nodo debemos dejar el nodo encendido las 24 horas
si es posible.
+Announcer.announceAlertNoSeednodes=No se encontro el archivo seeddnodes.fref,
el nodo no va a poder conectarse automaticamente a la opennet. Agregue nodos
manualmente o baje el archivo de seednodes de
http://downloads.freenetproject.org/alpha/opennet/.
+Announcer.announceAlertShort=El nodo esta intentando conectarse a la red,
puede que este lento por un momento.
+Announcer.announceAlertTitle=Nodo Anunciandose
+Announcer.announceDisabledTooOldShort=El nodo intento conectarse a la red pero
la version de Freenet que esta corriendo es muy vieja: actualizela por favor!
+Announcer.announceLoading=El nodo de Freenet esta cargando el archivo
seednodes para intentar anunciarce frente al resto de la red. Estos anuncios
pueden demorar unos minutos.
+Announcer.coolingOff=Por los proximos ${time} segundos, el nodo va a esperar
a los nodos frente a los cuales se anuncio para conectar. Si no hay suficientes
nodos disponibles, intentara conectarse a otro.
Bookmark.noName=sin nombre
BookmarkEditorToadlet.addBookmark=A?adir marcador
BookmarkEditorToadlet.addCategory=A?adir categor?a
@@ -50,6 +57,7 @@
BookmarkManager.malformedBookmark=Marcador incorrecto
BooleanOption.parseError=Booleano no comprendido: ${val} - Pruebe con 'true' o
'false'
BuildOldAgeUserAlert.tooOld=Este nodo es m?s antiguo que la versi?n m?s
antigua (versi?n #${lastgood}) admitida por su contacto m?s actualizado. Por
favor, actualice su nodo pr?ximamente dado que no podr? interoperar con
contactos marcados como DEMASIADO NUEVO (TOO NEW) hasta que lo haga. (Su nodo
puede ser dejado atr?s por Freenet si no se actualiza).
+BuildOldAgeUserAlert.tooOldShort=El nodo esta ocrriendo una version tan
antigua de Freenet que no puede conectarse a ningun otro nodo! Actualizalo!
BuildOldAgeUserAlert.tooOldTitle=Versi?n anticuada
CSSTokenizerFilter.deletedDisallowedString=Cadena desautorizada borrada
CSSTokenizerFilter.deletedUnmatchedChar=car?cter descartado sin emparejamiento:
@@ -203,7 +211,7 @@
ExtOldAgeUserAlert.extTooOldShort=El archivo freenet-ext.jar esta
desactualizado, actualizar!
ExtOldAgeUserAlert.extTooOldTitle=Freenet-ext demasiado antiguo
FProxyToadlet.abortToHomepage=Abortar y volver a la p?gina principal de FProxy
-FProxyToadlet.alertsTitle=Alertas
+FProxyToadlet.alertsTitle=Avisos
FProxyToadlet.backToFProxy=${link}Pulse aqu?${/link} para ir a la p?gina
principal de FProxy
FProxyToadlet.backToReferrer=${link}Pulse aqu?${/link} para volver a la p?gina
previa.
FProxyToadlet.cantBindPort=?No se puede asociar fproxy a ese puerto!
@@ -371,6 +379,7 @@
FirstTimeWizardToadlet.bwlimitLowerSpeed=m?nima velocidad
FirstTimeWizardToadlet.chooseNodeName=?Hace falta un nombre para el nodo!
FirstTimeWizardToadlet.chooseNodeNameLong=Por favor, proporcione un nombre
para el nodo en el campo siguiente (se recomienda un apodo con, si quiere, una
direcci?n de correo). Esto es para que sus amigos (contactos de confianza,
a?adidos manualmente) puedan identificarle con facilidad. Esto no se muestra a
los desconocidos (nodos no de confianza a?adidos autom?ticamente). Sepa que
cualquier contacto, amigo o desconocido, puede identificar trivialmente su
direcci?n IP, aunque no pueden saber con facilidad qu? peticiones est? usted
haciendo.
+FirstTimeWizardToadlet.clickContinue=Haga click aqui para continuar
FirstTimeWizardToadlet.congratz=?Bienvenido a bordo!
FirstTimeWizardToadlet.congratzLong=Enhorabuena, se ha completado la
configuraci?n b?sica de este nodo de Freenet. Puede cambiar cualquiera de los
parametros que acaba de ajustar yendo a la p?gina de "configuraci?n",
disponible en cualquier momento desde el men? de la izquierda. Le deseamos una
agradable experiencia con Freenet.
FirstTimeWizardToadlet.connectToStrangers=?Conectarse a desconocidos?
@@ -385,18 +394,27 @@
FirstTimeWizardToadlet.iDoTrust=?Conf?a en las conexiones desde ${interface}
(${ip}) ?
FirstTimeWizardToadlet.isNetworkTrusted=?Es de confianza la red local?
FirstTimeWizardToadlet.isNetworkTrustedLong=?Es de confianza la red local? Si
responde que s?, todos los servicios proporcionados por el nodo estar?n
abiertos a cualquiera que los solicite desde dicha red. Puede configurar
controles de acceso m?s espec?ficos en la p?gina de configuraci?n cuando
termine con el asistente.
+FirstTimeWizardToadlet.memoryLimit=Uso de memoria
FirstTimeWizardToadlet.noNetworkIF=No se han encontrado interfaces de red
adicionales
FirstTimeWizardToadlet.noNetworkIFLong=Freenet no ha encontrado ninguna
interfaz de red adicional. Se asumir? que s?lo va a conectarse al nodo desde
este computador.
+FirstTimeWizardToadlet.opennetNo=Tengo al menos 5 amigos que usan Freenet y
voy a agregar sus datos en la pagina de Amigos.
+FirstTimeWizardToadlet.opennetYes=Quiero que el nodo encuentre personas
(desconocidos) a los cuaales conectarse automaticamente.
FirstTimeWizardToadlet.skipWizard=?No soy un novato, omita el asistente!
FirstTimeWizardToadlet.step1Title=?Asistente para la primera vez en Freenet! -
Amigos y desconocidos
FirstTimeWizardToadlet.step2Title=?Asistente para la primera vez en Freenet! -
D? nombre al nodo
FirstTimeWizardToadlet.step3Title=?Asistente para la primera vez en Freenet! -
L?mites de transferencia
FirstTimeWizardToadlet.step4Title=?Asistente para la primera vez en Freenet! -
Tama?o del almac?n de datos
FirstTimeWizardToadlet.step5Title=?Asistente para la primera vez en Freenet! -
Configuraci?n de red
+FirstTimeWizardToadlet.step6Title=Ayudante para la primera vez: Uso de Memoria
FirstTimeWizardToadlet.step7Title=?Asistente para la primera vez en Freenet! -
Enhorabuena, el nodo est? configurado
+FirstTimeWizardToadlet.tenPercentDisk=(= 10% de espacio libre en disco)
FirstTimeWizardToadlet.warningTitle=Cuidado!
FirstTimeWizardToadlet.welcomeInfoboxContent1=Bienvenido al asistente para la
primera ejecuci?n de Freenet. Esta herramienta le ayudar? a poner a punto el
nodo r?pida y f?cilmente. Por favor,
FirstTimeWizardToadlet.welcomeInfoboxTitle=?Bienvenido al asistente para la
primera vez en Freenet!
+FirstTimeWizardToadlet.memory.128M=128MiB - lo minimo
+FirstTimeWizardToadlet.memory.192M=192MiB - razonable
+FirstTimeWizardToadlet.memory.256M=256MiB - si tenes al menos 1GiB de memoria
RAM
+FirstTimeWizardToadlet.memory.64M=64MiB - solo si tenes muy poca memoria
GIFFilter.invalidHeader=El documento no comienza con una cabecera GIF v?lida.
GIFFilter.invalidHeaderTitle=Cabecera inv?lida
GIFFilter.notGif=El documento que ha solicitado no es un GIF. Podr?a ser otro
formato, y el navegador podr?a hacer algo peligroso con ?l, por lo que ha sido
bloqueado.
@@ -512,6 +530,7 @@
LoggerHook.unrecognizedPriority=Nombre de prioridad desconocido: ${name}.
LongOption.parseError=El valor dado no se puede interpretar como un entero de
64 bits: ${val}
MeaningfulNodeNameUserAlert.noNodeNick=Parece que el nodo no conoce el apodo
del usuario operador (usted). Poner aqu? el apodo de IRC puede ser una buena
idea para ayudar a sus amigos a identificarle (note que s?lo sus amigos de la
red segura (darknet), que aparecen en la p?gina de amigos, pueden ver el nombre
del nodo. ?ste no se muestra a desconocidos).
+MeaningfulNodeNameUserAlert.noNodeNickShort=No esta definido el nombre de tu
nodo.
MeaningfulNodeNameUserAlert.noNodeNickTitle=El nombre del nodo est? por
definir.
N2NTMToadlet.composingMessageLabel=Escribiendo mensaje entre nodos (N2NTM)
para enviar a los siguientes contactos:
N2NTMToadlet.delayed=Demorado: el env?o del mensaje al contacto probablemente
se retrasar?
@@ -541,6 +560,7 @@
N2NTMUserAlert.title=Mensaje entre nodos ${number} desde ${peername} (${peer})
Node.alwaysAllowLocalAddresses=?Permitir siempre conectar a nodos a trav?s de
direcciones locales?
Node.alwaysAllowLocalAddressesLong=Si cierto (true), el nodo intentar?
conectar con otros a trav?s de su direcci?n local (localhost, LAN) adem?s de a
trav?s de las IPs p?blicas. Si no, puede activarse selectivamente para
contactos espec?ficos de la darknet (pero no para contactos de opennet). Active
esto si desea conectar con otros nodos en la misma LAN o computadora, y no le
importa que referencias falsas causen el env?o de paquetes UDP desde su nodo a
otras m?quinas en la misma LAN.
+Node.assumeNATed=Asumir que el puerto no esta redireccionado
Node.bandwidthLimitMustBePositiveOrMinusOne=El l?mite del ancho de banda debe
ser positivo ? -1
Node.bindTo=Direcci?n IP a la que asociarse
Node.bindToLong=Direcci?n IP a la que asociarse
@@ -568,6 +588,7 @@
Node.inBWLimit=L?mite de tasa de transferencia entrante (bytes por segundo)
Node.inBWLimitLong=L?mite para la tasa de entrada (bytes/s); el nodo intentar?
no sobrepasarlo; -1 = 4x set outputBandwidthLimit
Node.invalidStoreSize=El tama?o del almac?n debe ser de al menos 32MB
+Node.java14Title=Java 1.4 no es mas soportado
Node.l10nLanguage=El idioma que el nodo emplear? para mostrar mensajes
Node.l10nLanguageLong=Este ajuste cambia el idioma empleado para mostrar los
mensajes. Sepa que algunos textos no aparecer?n traducidos hasta el siguiente
arranque del nodo.
Node.maxHTL=HTL m?ximo
@@ -740,6 +761,7 @@
PproxyToadlet.Load=Cargar
PproxyToadlet.changeReloadOnStartup=Cambiar
PproxyToadlet.classNameTitle=Nombre de clase
+PproxyToadlet.fileonly=solo archivos locales
PproxyToadlet.internalIDTitle=ID interno
PproxyToadlet.loadOfficialPlugin=Agregar complemento oficial
PproxyToadlet.loadOfficialPluginLabel=Cargar complemento oficial
@@ -756,6 +778,7 @@
PproxyToadlet.pluginUnloadedWithName=Se ha retirado el complemento ${name}.
PproxyToadlet.plugins=Complementos
PproxyToadlet.pluginsWithNodeName=Complementos de ${name}
+PproxyToadlet.refreshOnStartup=Recargar desde el servidor cuando reinicie
PproxyToadlet.reload=Recargar
PproxyToadlet.reloadOnStartupShort=Recargar al iniciar
PproxyToadlet.reloadPluginTitle=Recargar Complemento
@@ -984,6 +1007,7 @@
TranslationToadlet.contributingToLabelWithLang=Est? contribuyendo a la
traducci?n ${lang}:
TranslationToadlet.currentTranslationLabel=Traducci?n actual
TranslationToadlet.downloadTranslationsFile=Descargar la traducci?n
+TranslationToadlet.gotoNext=Ir al proximo texto sin traducir?
TranslationToadlet.hideAlreadyTranslated=Ocultar textos ya traducidos
TranslationToadlet.noCustomTranslations=No hay una traducci?n personalizada
disponible.
TranslationToadlet.originalVersionLabel=Original (versi?n inglesa)
@@ -1026,16 +1050,17 @@
UserAlert.apply=Aplicar
UserAlert.hide=Ocultar
UserAlert.reset=Reiniciar
+UserAlertManager.alertsOnAlertsPage=| Ver en ${link}la apagina de
avisos${/link}.
UserAlertManager.alertsOnHomepage=| Cons?ltelas en la ${link}p?gina de
bienvenida${/link}.
-UserAlertManager.alertsTitle=Alertas significativas
+UserAlertManager.alertsTitle=Avisos importantes
UserAlertManager.criticalErrorCountLabel=Errores cr?ticos:
UserAlertManager.errorCountLabel=Errores:
UserAlertManager.minorCountLabel=Menor:
UserAlertManager.totalLabel=Total:
UserAlertManager.warningCountLabel=Avisos:
-UserAlertsToadlet.titleWithName=Alertas para ${name}
+UserAlertsToadlet.titleWithName=Avisos para ${name}
WelcomeToadlet.activityTitle=Actividad actual
-WelcomeToadlet.alertsSummary=Resumen de alertas
+WelcomeToadlet.alertsSummary=Resumen de avisos
WelcomeToadlet.arkFetchCount=Descargadores ARK: ${total}
WelcomeToadlet.confirmAddBookmarkSubTitle=Confirme la adici?n del marcador
WelcomeToadlet.confirmAddBookmarkTitle=A?adir un marcador
@@ -1046,7 +1071,7 @@
WelcomeToadlet.confirmFIN=?Desea insertar el siguiente mensaje de Frost?
WelcomeToadlet.databaseStatsSubTitle=Estad?sticas de la base de datos
WelcomeToadlet.databaseStatsTitle=Obtener estad?sticas de JE
-WelcomeToadlet.disabledAlert=Alerta desactivada
+WelcomeToadlet.disabledAlert=Aviso desactivado
WelcomeToadlet.extVersion=Freenet-ext Compilaci?n #${build} r${rev}
WelcomeToadlet.extVersionWithRecommended=Freenet-ext Compilaci?n #${build} (se
recomienda ${recbuild}) r${rev}
WelcomeToadlet.fetch=Descargar
Modified: branches/db4o/freenet/src/freenet/l10n/freenet.l10n.it.properties
===================================================================
--- branches/db4o/freenet/src/freenet/l10n/freenet.l10n.it.properties
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/l10n/freenet.l10n.it.properties
2008-09-25 01:21:24 UTC (rev 22832)
@@ -8,6 +8,7 @@
Announcer.announceDisabledTooOldTitle=Annuncio disabilitato (obsoleto)
Announcer.announceLoading=Il nodo sta caricando il file seednodes per
annunciarsi al resto della rete. Il completamento dell' operazione potrebbe
richiedere diversi minuti.
Announcer.coolingOff=per i prossimi ${time} secondi, il nodo aspetter? che i
nodi che ha annunciato si connettano; se non ci saranno abbastanza nodi prover?
con un altro nodo.
+Announcer.dontKnowAddress=Non ? stato possibile determinare l'indirizzo IP del
computer dover Freenet sta girando. Non ? possibile procedere all' annuncio
finch? non si conosce l'IP.
Bookmark.noName=nessun nome
BookmarkEditorToadlet.addBookmark=Aggiungi Segnalibro
BookmarkEditorToadlet.addCategory=Aggiungi Categoria
@@ -88,11 +89,15 @@
ConfigToadlet.fullTitle=Configurazione del nodo Freenet: ${name}
ConfigToadlet.homepage=Homepage del Nodo
ConfigToadlet.logger=log
+ConfigToadlet.needRestart=Config necessita riavvio per attivarsi. Si prega di
riavviare il nodo immediatamente.
+ConfigToadlet.needRestartShort=Config necessita riavvio per attivarsi. Si
prega di riavviare il nodo immediatamente.
+ConfigToadlet.needRestartTitle=E' necessario riavviare il nodo
ConfigToadlet.node=nodo
ConfigToadlet.pluginmanager=pluginmanager
ConfigToadlet.pluginmanager2=pluginmanager2
ConfigToadlet.possibilitiesTitle=Scegli Azione:
ConfigToadlet.reset=Annulla
+ConfigToadlet.restartNode=Riavvia Adesso
ConfigToadlet.returnToNodeConfig=Torna alla configurazione del nodo
ConfigToadlet.returnToNodeHomepage=Torna alla homepage del nodo
ConfigToadlet.shortTitle=Configurazione
@@ -306,6 +311,7 @@
FProxyToadlet.openPossRSSForceDisk=${link}Clicca qui${/link} per cercare di
costringere il browser a scaricare il file su disco (${bold}Pu? essere
pericoloso se si sta usando Firefox 2.0.0${/bold} ; il problema dovrebbe essere
risolto in 2.0.1).
FProxyToadlet.openRSSAsRSS=${link}Clicca qui${/link} per aprire il file come
RSS (ci? ${bold}rappresenta un pericolo${/bold} se l'autore del sito ? mal
intenzionato, perch? il filtraggio di RSS in Freenet non ? ancora stato
implementato).
FProxyToadlet.openRSSForce=${link}Clicca qui${/link} per aprire il file come
${mime} (ci? ${bold}pu? costituire un pericolo${/bold} se si usa IE7 o FF2).
+FProxyToadlet.openWithKeyExplorer=${link}Cliccare qui${/link} per aprire la
freenet uri con key explorer
FProxyToadlet.opennet=gestisci connessioni non affidabili
FProxyToadlet.opennetTitle=Sconosciuti
FProxyToadlet.options=Opzioni disponibili:
@@ -449,17 +455,22 @@
FirstTimeWizardToadlet.datastoreSizeLong=Selezionare le dimensione desiderata
per il file di immagazzinaggio dati (datastore). Il datastore funziona come una
cache. Immagazzinare dati per il network aumenta il volume di scambio quando i
file sono molto richiesti. Pi? spazio ci si pu? permettere di dedicare a
Freenet e meglio ? per la comunit?. Un datastore di grosse dimensioni aumenta
notevolmente la velocit? del nodo.
FirstTimeWizardToadlet.enableOpennet=Connettersi automaticamente a nodi non
affidabili gestiti da sconosciuti?
FirstTimeWizardToadlet.fivePercentDisk=(= 5% di spazio libero su disco)
+FirstTimeWizardToadlet.friendsSecurityPageTitle=Configurazione automatica di
Freenet: Impostazioni Sicurezza Amici
+FirstTimeWizardToadlet.highNetworkThreatLevelCheckbox=Conosco almeno una
persona che gi? usa Freenet (meglio 3, almeno 5-10 per ottenere buone
prestazioni) che aggiunger? alla pagina degli Amici. Mi rendo conto che Freenet
non potr? funzionare quando nessuno dei miei Amici ? connesso.
+FirstTimeWizardToadlet.highNetworkThreatLevelWarning=${bold}ATTENZIONE${/bold}:
Il livello di sicurezza in rete sta per essere impostato su ALTO. Ci?
significa che il nodo rester? incapace di connettersi se non ${bold}vengono
aggiunte connessioni ad Amici${/bold}. Gli Amici ai quali connettersi
dovrebbero essere persone consciute e delle quali sia possibile fidarsi almeno
parzialmente. Se non si conoscono utenti Freenet, utilizzare il livello di
sicurezza NORMALE che permette a Freenet di connettersi automaticamente.
Aggiungere degli sconosciuti agli Amici influirebbe negativamente sulle
prestazioni e non migliorerebbe la sicurezza. Inoltre, usando il livello di
sicurezza ALTO Freenet risulter? pi? lento soprattutto se si hanno pochi Amici
(ne occorrono almeno 5-10 per ottenere buone prestazioni)
FirstTimeWizardToadlet.homepageTitle=Configurazione Automatica Freenet
FirstTimeWizardToadlet.iDoTrust=Possiamo fidarci degli utenti connessi a
${interface} (${ip}) ?
FirstTimeWizardToadlet.isNetworkTrusted=La rete locale ? affidabile?
FirstTimeWizardToadlet.isNetworkTrustedLong=La rete locale ? affidabile?
Rispondendo di si a questa domanda, tutti i servizii forniti dal nodo Freenet
saranno pienamente accessibili da chiunque sul network suddetto. E' possibile
configurare un accesso pi? selettivo attraverso la pagina "configurazione" dopo
aver completato questo wizard.
FirstTimeWizardToadlet.memoryLimit=Utilizzo memoria
FirstTimeWizardToadlet.memoryLimitLong=Specifica il valore massimo della
memoria utilizzabile da Freenet. Il nodo ha bisogno di pi? memoria se ci sono
molti file in coda per il download/upload. Si raccomanda di non impostare
questa opzione per un valore inferiore a 128MB tranne nel caso in cui la
memoria totale a disposizione sia veramente poca. Se il computer ha 1GB di
memoria RAM o pi?, si consiglia di usare almeno 256MB. Il cambiamento avr?
effetto dopo aver riavviato Freenet.
+FirstTimeWizardToadlet.networkSecurityPageTitle=Configurazione automatica di
Freenet: Impostazioni Sicurezza Rete
FirstTimeWizardToadlet.noNetworkIF=Non ? stata trovata nessuna interfaccia di
rete addizionale
FirstTimeWizardToadlet.noNetworkIFLong=Freenet non ha trovato altre interfacce
di rete, quindi dar? per scontato che l'utente si connetter? dal computer
locale e solo da quello.
FirstTimeWizardToadlet.opennetNo=Si, ho almeno 5 amici che usano Freenet e
aggiunger? i loro dati alla pagina degli Amici.
FirstTimeWizardToadlet.opennetWarning=In Paesi dove networking anonimo ?
illegale e/o se usa Freenet per accedere a materiale che potrebbe mettere nei
guai chi ne fosse trovato in possesso, un serio pericolo pu? risultare dal
configurare il nodo in modo da connettersi automaticamente a nodi gestiti da
sconosciuti, facilitando il il compito ad un avversario determinato. Freenet ?
ancora in fase sperimentale, gli autori non sono in grado di garatire sicurezza
assoluta.
FirstTimeWizardToadlet.opennetYes=No, voglio che il nodo trovi automaticamente
degli sconosciuti ai quali connettersi.
+FirstTimeWizardToadlet.physicalSecurityPageTitle=Configurazione automatica di
Freenet: Impostazioni Sicurezza Fisica
FirstTimeWizardToadlet.selectLanguage=Lingua
FirstTimeWizardToadlet.selectLanguageLong=Selezionare una lingua dalla lista
qui sotto:
FirstTimeWizardToadlet.skipWizard=Non sono un novellino, lascia perdere il
wizard.
@@ -672,6 +683,8 @@
Node.dropPacketEveryLong=Frequenza di rilascio dei pacchetti. Opzione di
collaudo usata dagli sviluppatori per simulare la perdita di pacchetti. 0
significa non rilasciare pacchetti artificialmente. Non toccare!
Node.enableARKs=Abilita ARK? (NON DISABILITARE!)
Node.enableARKsLong=Abilita ARK? (NON DISABILITARE!).
+Node.enableOpennetFailed=Non ? stato possibile abilitare Opennet e pertanto il
nodo non potr? connettersi a Sconosiuti. Bisognerebbe risolvere il problema,
rioprtare un bug, o continuare a connettersi esclusivamente ad Amici. Dettagli:
${message}
+Node.enableOpennetFailedTitle=Abilitazione opennet fallita
Node.enablePacketCoalescing=Abilita coalescenza pacchetti?
Node.enablePacketCoalescingLong=Ablilita coalescenza pacchetti? La coalescenza
dei pacchetti aumenta l'efficienza della banda, ruduce l'uso di CPU e aumenta
leggermente la resistenza all'analisi di traffico, al costo di una leggera
latenza dei messaggi. Si consiglia di non disabilitare questa opzione.
Node.enablePerNodeFailureTables=Abilita tabelle operazioni fallite per nodi?
@@ -722,6 +735,10 @@
Node.publishOurPeersLocationLong=Trasmettere ai peer la locazione dei nostri
peer? Ci? facilita il routing ma fornisce informazioni ad un potenziale
avversario.
Node.routeAccordingToOurPeersLocation=Tenere conto nel routing della locazione
dei peer dei nostri peer?
Node.routeAccordingToOurPeersLocationLong=Usare per il routing la locazione
dei peer dei nostri peer? Ci? facilita il routing ma potrebbe essere utile ad
un potenziale avversario.
+Node.storeBloomFilterCounting=Usare filtro 'counting bloom'?
+Node.storeBloomFilterCountingLong=Usare filtro 'counting bloom' a 2 bit? (in
caso di dubbio, non modificare)
+Node.storeBloomFilterSize=Dimensione del bloom filter size (totale) in bytes
+Node.storeBloomFilterSizeLong=Dimensioni del filtro bloom in bytes. Di solito
1/2048 della dimensione del datastore ? pi? che abbastanza. Impostare su zero
per disabilitare il bloom filter.
Node.storeDirectory=Directory magazzino dati (store)
Node.storeDirectoryLong=Directory contenente gli store file
Node.storeMaxMemTooHigh=Impostare un valore superiore ad 80% della memoria RAM
da destinare a BDB ? generalmente una pessima idea.
@@ -743,16 +760,26 @@
NodeClientCore.downloadAllowedDirsLong=Si pu? usare una lista di directory
dove dove il download e' permesso, separate da 'punto e virgola' (;).
"downloads" significa downloadsDir, vuoto (nessuna directory specificata)
significa che il download su disco non e' permesso, "all" significa download
permessi in tutte le directory AVVERTENZA; Se impostato su "all" ("tutte"),
ogni utente potr? scaricare files in qualsiasi directory.
NodeClientCore.downloadDir=Directory predefinita per i download
NodeClientCore.downloadDirLong=Directory predefinita dove salvare i file
scaricati
+NodeClientCore.encryptPersistentTempBuckets=Codificare i bucket di dati
temporanei? NON MODIFICARE!
+NodeClientCore.encryptPersistentTempBucketsLong=Codificare bucket di dati
temporanei persistenti? In alcuni casi ci? non ? strettamente necessario (p.es.
se di fa uso di hard-drive e swap encryption). IN CASO DI DUBBIO, NON MODIFCARE
+NodeClientCore.encryptTempBuckets=Codificare i buckets di dati temporanei? NON
MODIFICARE!
+NodeClientCore.encryptTempBucketsLong=Codificare bucket di dati temporanei? In
alcuni casi ci? non ? strettamente necessario (p.es. se di fa uso di hard-drive
encryption). IN CASO DI DUBBIO, NON MODIFCARE
NodeClientCore.fileForClientStats=File contenente statistiche del client
NodeClientCore.fileForClientStatsLong=File dove conservare le statistiche
relative al client throttling (utilizzato per stabilire l'intervallo tra le
richieste)
NodeClientCore.lazyResume=Caricare completamente le richieste persistenti dopo
aver completato l'avvio del nodo? (Fa maggiore uso di memoria ma avvia il nodo
pi? velocemente)
NodeClientCore.lazyResumeLong=Le richieste persistenti possono essere caricate
durante l'avvio del nodo, oppure si possono scrivere i dati in memoria e
caricarli completamente solo dopo che il processo di avvio ? terminato. Ci?
riduce tempo di avviamento ma fa maggior uso di memoria.
+NodeClientCore.maxArchiveSize=Dimensioni massime di ogni archivio
+NodeClientCore.maxArchiveSizeLong=Dimensione massima di ogni archivio
+NodeClientCore.maxRAMBucketSize=Dimensioni massime di un RAMBucket
+NodeClientCore.maxRAMBucketSizeLong=Dimensioni massime di un RAMBucket (i
bucket di dimensioni maggiori saranno immagazzinati sul disco rigido)
NodeClientCore.maxUSKFetchers=Numero massimo di USK fetchers ammessi
NodeClientCore.maxUSKFetchersLong=Numero massimo di USK fetchers ammessi
NodeClientCore.maxUSKFetchersMustBeGreaterThanZero=Deve essere maggiore di zero
NodeClientCore.movingTempDirOnTheFlyNotSupported=Non ? possible cambiare la
directory dei file temporanei mentre il nodo ? in funzione
NodeClientCore.persistentTempDir=Directory dei file temporanei persistenti
NodeClientCore.persistentTempDirLong=Nome della directory dei file temporanei
persistenti
+NodeClientCore.ramBucketPoolSize=Quantit? di RAM da dedicare ai bucket di dati
temporanei
+NodeClientCore.ramBucketPoolSizeLong=Quantit? di RAM da dedicare ai bucket di
dati temporanei che verrebbero altrimenti immagazzinati sul disco rigido.
L'equilibrio sta nel maggiore uso di memoria contro pi? I/O.
NodeClientCore.startingUp=Si prega di concedere a Freenet alcuni minuti per
completare il processo di avviamento. Nel frattempo alcune funzioni non saranno
disponibili e il nodo potr? risultare pi? lento del normale.
NodeClientCore.startingUpShort=L'avviamento di Freenet ? ancora in corso:
alcune funzioni potrebbero non essere ancora disponibili e il nodo potrebbe
operare ad una velocit? inferiore al normale.
NodeClientCore.startingUpTitle=Avviamento di Freenet in corso
@@ -1063,6 +1090,66 @@
SSL.keyStorePassLong=Password per l'accesso di key store file
SSL.version=Versione di SSL
SSL.versionLong=Versione di SSL, SSLv3 o TLSv1 (default SSLv3)
+SaltedHashFreenetStore.cleanerAlertTitle=Manutenzione del datastore (magazzino
dati) in corso
+SaltedHashFreenetStore.longRebuildProgress=Manutenzione del datastore(${name})
in corso: ${processed}/${total}. Il nodo potrebbe risultare pi? lento durante
questa operazione. Evitare di riavviare il nodo durante il processo.
+SaltedHashFreenetStore.longResizeProgress=Ridimensionamento del
datastore(${name}) in corso: ${processed}/${total}. Il nodo potrebbe risultare
pi? lento durante questa operazione. Evitare di riavviare il nodo durante il
processo.
+SaltedHashFreenetStore.shortRebuildProgress=Manutenzione del
datastore(${name}) in corso: ${processed}/${total}
+SaltedHashFreenetStore.shortResizeProgress=Ridimensionamento del
datastore(${name}) in corso: ${processed}/${total}
+SecurityLevels.fewConnectedFriendsCheckbox=Si sono sicuro, aggiunger? altri
Amici e/o accetto il costo in prestazioni e il fatto che Freenet potrebbe
disconnettersi quando gli Amici non sono on-line.
+SecurityLevels.fewConnectedFriendsWarning=Soltanto ${connected} Amici sono
attualmente connessi, su un totale di ${added}. Impostando il livello di
sucurezza in rete MASSIMO, Freenet si connetter? esclusivamente agli Amici,
cio? peer affidabili aggiunti manualmente. Ci? potrebbe provocare un
abbassamento nelle prestazioni generali dovuto alla riduzione del numero di
connessioni. Se tutti gli Amici si trovassero ad essere 'off line' allo stesso
tempo, il nodo si ritroverebbe completamente disconnesso dalla rete. E' bene
ricordare che gli Amici devono essere persone conosciute e delle quali ci si
fida almeno parzialmente; in mancanza di questa condizione, l'uso esclusivo di
connessioni ad Amici non produce alcun vantaggio. Inoltre, per un corretto
funzionamento di Freenet ? necessario che il nodo possa in qualsiasi momento
connettersi ad almeno 5-10 peer. Prima di procedere, verificare l'esistenza di
tutte le condizioni di cui sopra.
+SecurityLevels.friendsThreatLevel=Quanto sarebbe preoccupante, se le persone i
cui nodi sono connessi come Amici spiassero la nostra attivit?, deliberatamente
o come risultato di una compromissione? (Questa ? una configurazione di default
che pu? essre impostata separatamente per ognuno degli Amici). Impostando il
livello di sicurezza in rete su ALTO, le prestazioni sartanno determinate dai
livelli di sicurezza degli Amici, oltre che dal numero degli Amici stessi.
+SecurityLevels.friendsThreatLevelConfirmTitle=ATTENZIONE: Il livello di
sicurezza per gli Amici verr? impostato su: ${mode}
+SecurityLevels.friendsThreatLevelShort=Protezione contro attacchi all'
anonimato da parte di amici
+SecurityLevels.highFriendsThreatLevelCheckbox=Si sono sicuro; ho bisogno di un
alto livello di protezione contro i nodi di amici doppiogiochisti o i cui nodi
sono stati compromessi.
+SecurityLevels.highFriendsThreatLevelWarning=Il livello di sicurezza ver?
impostato su ALTO. Questa impostazione causa una diminuzione delle prestazioni
di Freenet, e il pi? delle volte non ? necessario farne uso. Se il motivo
dietro il cambiamento ? la preoccupazione causata dall' avere aggiunto degli
sconosciuti alla lista di Amici (peer affidabili), sarebbe bene prendere in
considerazione l'idea di disconnetterli e riportare il livello di sicurezza su
NORMALE. D'altro canto se ci si aspetta degli attachi o ci si aspetta che i
computer di alcuni Amici potrebbero venire compromessi, innalzare il livello di
sicurezza come precauzione non ? una cattiva idea.
+SecurityLevels.maxSecurityYouNeedFriends=${bold}E' necessario conoscere almeno
una persona che gi? usa Freenett${/bold}, possibilmente 3, e tra 5 e 10 per
ottenere buone prestazioni. Tali utenti vanno aggiunti alla pagine degli Amici,
ma solo se si tratta di persone conosciute ed almeno parzialmente affidabili.
+SecurityLevels.maximumNetworkThreatLevelCheckbox=Si voglio abilitare il
livello di sicurezza in rete MASSIMO. Mi rendo conto che Freenet ? un programma
sperimentale e che nonostante le precauzioni potrebbe essere possibile essere
rintracciati, e del fatto che questa impostazione ridurr? sensibilmente le
prestazioni di Freenet.
+SecurityLevels.maximumNetworkThreatLevelWarning=${bold}ATTENZIONE:${/bold} Il
livello di sicurezza in rete sta per essere impostato su MASSIMO. Ci? ridurr?
${bold}notevolmente${/bold} la velocit? di trasferimento di file da e per
questo nodo! Si prega di non utilizzare questa impostazione se non in caso di
effettiva necessit?.
+SecurityLevels.networkThreatLevel=Quanto ? necessario difendersi da Internet
Service Providers, corporazioni, governi, ragazzini annoiati ecc. che cercano
di monitorare l'utilizzo di Freenet da parte dell' Utente?
+SecurityLevels.networkThreatLevelConfirmTitle=ATTENZIONE: Il livello di
sicurezza in rete verr? impostato su ${mode}
+SecurityLevels.networkThreatLevelLowCheckbox=Si sono sicuro, voglio
prestazioni migliori e non mi importa di chi pu? vedere quello che faccio con
Freenet
+SecurityLevels.networkThreatLevelLowWarning=Il livello di sicurezza in rete
verr? impostato du livello BASSO. Ci? facilita attacchi all' anonimato da parte
di sconosciuti attraverso internet. Conferma di voler eseguire l'operazione?
+SecurityLevels.networkThreatLevelShort=Protezione contro attacchi da parte di
sconosciuti attraverso internet
+SecurityLevels.noConnectedFriendsCheckbox=Si sono sicuro, aggiunger? altri
Amici e/o accetto che Freenet sar? on-line soltanto quando gli Amici
attualmente in lista sono connessi.
+SecurityLevels.noConnectedFriendsWarning=Nonostante ${added} Amici siano stati
aggiunti alla lista, nessuno di essi risulta attualmente collegato. Impostando
il livello di sicurezza in rete su ALTO o MASSIMO, non sar? possibile
connettersi ad altri che ai nodi gestiti da Amici, dei quali nessuno reperibile
in questo momento. Le possibilit? a diposizione sono: aggiungere altri Amici,
usare Freenet solo quando gli Amici sono connessi, o evitare di usare alti
livelli di sicurezza. Per ottenere un vantaggio reale, gli Amici devono essere
persone conosiute ed affidabili; per ottenere buone prestazioni ? necessario
che in ogni dato momento siano connessi almeno 5-10 Amici. Conferma il cambio
impostazioni di sicurezza?
+SecurityLevels.noFriendsCheckbox=Si sono sicuro, desidero abilitare livello
ALTO di sicurezza in rete; aggiunger? degli Amici al pi? presto possibile.
+SecurityLevels.noFriendsWarning=Nessun nodo ? stato aggiunto agli Amici.
Configurando il livello di sicurezza in rete su ALTO o MASSIMO, non sar?
possibile connettersi a Freenet finch? non sar? aperta almeno una connessione
ad Amici. Perch? ci? comporti un effettivo vantaggio, ? necessario che le
persone in questione siano conosciute ed almeno parzialmente affidabili; per
ottenere delle buone prestazioni, ? necessario che almeno 5-10 connessioni
siano aperte in ogni momento. Conferma la modifica delle impostazioni di
sicurezza?
+SecurityLevels.physicalThreatLevel=Se il computer fosse rubato o sottoposto a
sequestro giudiziario ed esaminato, quanto grave sarebbe questo fatto?
+SecurityLevels.physicalThreatLevelShort=Protezione in caso di furto o
sequestro giudiziario del computer
+SecurityLevels.title=Livelli di sicurezza
+SecurityLevels.tooltip=Configurazione del livello di sicurezza del nodo
+SecurityLevels.userAlertExtro=E' possibile modificare queste impostazioni alla
${link}Pagina della Configurazione${/link}.
+SecurityLevels.userAlertFriendsThreatLevel=Protezione in caso di attacco all'
anonimato da parte di amici: ${level}
+SecurityLevels.userAlertNetworkThreatLevel=Protezione contro attacchi da parte
di sconosciuti attraverso internet: ${level}
+SecurityLevels.userAlertPhysicalThreatLevel=Protezione nel caso di furto o
sequestro giudiziario del computer: ${level}
+SecurityLevels.userAlertShortText=Livelli di Sicurezza: Rete: ${network},
Amici: ${friends}, Fisico: ${physical}
+SecurityLevels.friendsThreatLevel.choice.HIGH=Desidero che Freenet preda
precauzioni supplementari per evitare gli attacchi da parte di Amici.
+SecurityLevels.friendsThreatLevel.choice.LOW=Gli attacchi da parte di Amici
non mi preoccupano: posso fidarmi di loro e della loro abilit? nel campo della
sicurezza informatica.
+SecurityLevels.friendsThreatLevel.choice.NORMAL=Gli attacchi da parte di Amici
non mi preoccupano pi? di tanto ma vorrei comunque che Freenet prendesse
precauzioni ragionevoli.
+SecurityLevels.friendsThreatLevel.desc.HIGH=Freenet non condivider?
informazioni con gli Amici, risultando quindi leggermente pi? lento di come
sarebbe in modalit? NORMALE
+SecurityLevels.friendsThreatLevel.desc.LOW=Freenet condivider? moltissime
informazioni con gli Amici massimizzando le prestazioni.
+SecurityLevels.friendsThreatLevel.desc.NORMAL=Freenet condivider? una quantit?
limitata di informazioni con gli Amici, e sar? pi? sento di come sarebbe a
livello BASSO.
+SecurityLevels.friendsThreatLevel.name.HIGH=ALTO
+SecurityLevels.friendsThreatLevel.name.LOW=BASSO
+SecurityLevels.friendsThreatLevel.name.NORMAL=NORMALE
+SecurityLevels.networkThreatLevel.choice.HIGH=Voglio rendere il monitoraggio
delle mie comunicazioni pi? difficile possibile e/o credo che il mio Internet
Service Provider stia cercando di bloccare Freenet.
+SecurityLevels.networkThreatLevel.choice.LOW=Il monitoraggio non mi preoccupa,
voglio massimizzare le prestazioni.
+SecurityLevels.networkThreatLevel.choice.MAXIMUM=E' mia intenzione accedere
informazioni che potrebbero esseere fonte di problemi quali arresto,
imprigionamento, o peggio, qualora ne fossi trovato in possesso. Mi rendo conto
che Freenet ? ancora allo stato sperimentale e che non ? in grado di garantire
al 100% la sicurezza contro alcuni attacchi di tipo conosciuto, ma accetto i
rischi.
+SecurityLevels.networkThreatLevel.choice.NORMAL=Vivo in un paese relativamente
libero ma vorrei comunque rendere pi? difficile il monitoraggio delle mie
comunicazioni.
+SecurityLevels.networkThreatLevel.desc.HIGH=Freenet si connetter?
esclusivamente agli Amici, quindi ${bold}per poter utilizzare questa modalit? ?
necessario avere almeno un amico che usi Freenet ${/bold}. Freenet risulter?
piuttosto lento se non si aggiungono almeno 5-10 Amici, e non funzioner? per
niente se non se ne ha almeno uno.
+SecurityLevels.networkThreatLevel.desc.LOW=Potrebbe essere facile scoprire la
vera identit? dell' Utente!
+SecurityLevels.networkThreatLevel.desc.MAXIMUM=Freenet sar?
${bold}notevolmente${/bold} pi? lento rispetto al livello ALTO.Per poter fare
usare questa modalit? ${bold}? necessario avere amici che siano utenti
Freenet${/bold}.
+SecurityLevels.networkThreatLevel.desc.NORMAL=Freenet prender? ragionevoli
precauzioni per difendere l'anonimato dell'Utente ad un lieve costo in
prestazioni. Freenet si connetter? automaticamente a nodi gestiti da
Sconosciuti. Si raccomanda di aggiungere Amici che usano Freenet ed impostare
il livello di sicurezza su ALTO.
+SecurityLevels.networkThreatLevel.name.HIGH=ALTO
+SecurityLevels.networkThreatLevel.name.LOW=BASSO
+SecurityLevels.networkThreatLevel.name.MAXIMUM=MASSIMO
+SecurityLevels.networkThreatLevel.name.NORMAL=NORMALE
+SecurityLevels.physicalThreatLevel.choice.LOW=Non preoccupante.
+SecurityLevels.physicalThreatLevel.choice.NORMAL=Preoccupante.
+SecurityLevels.physicalThreatLevel.desc.LOW=Freenet non user? 'encrypting'
(codifica) del disco e lascer? tracce dell' attivit? dell' Utente sul disco
rigido. Ci? migliorerr? le prestazioni di Freenet pagando un prezzo in termini
di minore sicurezza nel caso che il computer venisse rubato o sottoposto a
sequesto guidiziario.
+SecurityLevels.physicalThreatLevel.desc.NORMAL=Freenet provveder? alla
codifica di file temporanei etc, ad un piccolo prezzo in prestazioni, ma
sarebbe bene perndere ulteriori precauzioni come per esempio disabilitare la
cache del web browser quando si usa L'interfaccia web. Se si fa uso di download
persistenti (la maggioranza delle utilit? Freenet li usa), ? buona norma
provvedere all 'encrypting' (codifica) del drive di Freenet.
+SecurityLevels.physicalThreatLevel.name.LOW=BASSO
+SecurityLevels.physicalThreatLevel.name.NORMAL=NORMALE
ShortOption.parseError=Il valore specificato non pu? essere interpretato come
16-bit integer : ${val}
SimpleToadletServer.advancedMode=Abilita modalit? avanzata
SimpleToadletServer.advancedModeLong=Mostra informazioni cho possono
interessare solo utenti avanzati o sviluppatori. Nella maggioranza dei casi
dovrebbe essere impostata su 'falso'
@@ -1093,6 +1180,8 @@
SimpleToadletServer.illegalCSSName=Il nome CSS non pu? contenere i catarreri
"barra" (/ slash) e "due punti" ( : colon)
SimpleToadletServer.panicButton=Mostra bottone Emergenza
SimpleToadletServer.panicButtonLong=Mostra il bottone Emergenza nella pagina
della Coda. Se usato, Il bottone Emergenza rimuove tutte le richieste che non
hanno ricevuto conferma.
+SimpleToadletServer.passthroughMaxSize=Dimensione massima per pass-though
trasparente in FProxy
+SimpleToadletServer.passthroughMaxSizeLong=Dimensione massima di un file per
pass-through trasparente in FProxy.
SimpleToadletServer.port=Numero della porta FProxy
SimpleToadletServer.portLong=Numero della porta FProxy
SimpleToadletServer.ssl=Abilitare ssl?
@@ -1210,6 +1299,7 @@
TranslationToadlet.contributingToLabelWithLang=Stai contribuendo alla
traduzione: ${lang}:
TranslationToadlet.currentTranslationLabel=Traduzione corrente
TranslationToadlet.downloadTranslationsFile=Scarica il file della traduzione
+TranslationToadlet.gotoNext=Vai alla prossima stringa non tradotta?
TranslationToadlet.hideAlreadyTranslated=Nascondi stringhe tradotte
TranslationToadlet.noCustomTranslations=Nessuna traduzione personalizzata
disponibile.
TranslationToadlet.originalVersionLabel=Originale (versione inglese)
Modified: branches/db4o/freenet/src/freenet/node/AnnounceSender.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/AnnounceSender.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/AnnounceSender.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -93,7 +93,6 @@
// Now route it.
HashSet nodesRoutedTo = new HashSet();
- HashSet nodesNotIgnored = new HashSet();
PeerNode next = null;
while(true) {
if(logMINOR) Logger.minor(this, "htl="+htl);
@@ -121,7 +120,8 @@
if(onlyNode == null) {
// Route it
- next = node.peers.closerPeer(source, nodesRoutedTo,
nodesNotIgnored, target, true, node.isAdvancedModeEnabled(), -1, null, null);
+ next = node.peers.closerPeer(source, nodesRoutedTo, target,
true, node.isAdvancedModeEnabled(), -1,
+ null, null);
} else {
next = onlyNode;
if(nodesRoutedTo.contains(onlyNode)) {
Modified: branches/db4o/freenet/src/freenet/node/CHKInsertSender.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/CHKInsertSender.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/CHKInsertSender.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -269,7 +269,6 @@
private void realRun() {
HashSet nodesRoutedTo = new HashSet();
- HashSet nodesNotIgnored = new HashSet();
PeerNode next = null;
while(true) {
@@ -296,7 +295,8 @@
}
// Route it
// Can backtrack, so only route to nodes closer than we are to
target.
- next = node.peers.closerPeer(source, nodesRoutedTo,
nodesNotIgnored, target, true, node.isAdvancedModeEnabled(), -1, null, null);
+ next = node.peers.closerPeer(source, nodesRoutedTo, target, true,
node.isAdvancedModeEnabled(), -1, null,
+ null);
if(next == null) {
// Backtrack
Modified: branches/db4o/freenet/src/freenet/node/NetworkIDManager.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/NetworkIDManager.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/NetworkIDManager.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -10,6 +10,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import freenet.io.comm.ByteCounter;
import freenet.io.comm.DMT;
@@ -17,7 +18,6 @@
import freenet.io.comm.Message;
import freenet.io.comm.MessageFilter;
import freenet.io.comm.NotConnectedException;
-
import freenet.support.Logger;
import freenet.support.ShortBuffer;
import freenet.support.math.BootstrappingDecayingRunningAverage;
@@ -30,7 +30,7 @@
* @author robert
* @created 2008-02-06
*/
-public class NetworkIDManager implements Runnable, Comparator {
+public class NetworkIDManager implements Runnable,
Comparator<NetworkIDManager.PeerNetworkGroup> {
public static boolean disableSecretPings = true;
public static boolean disableSecretPinger = true;
public static boolean disableSwapSegregation = true;
@@ -40,7 +40,7 @@
//Intervals between connectivity checks and NetworkID reckoning.
//Checks for added peers may be delayed up to LONG_PERIOD, so don't
make it too long.
- //Coincedently, LONG_PERIOD is also the interval at which we send out
FNPNetworkID reminders.
+ //Coincidentally, LONG_PERIOD is also the interval at which we send out
FNPNetworkID reminders.
private static final long BETWEEN_PEERS = 2000;
private static final long STARTUP_DELAY = 20000;
private static final long LONG_PERIOD = 120000;
@@ -59,8 +59,8 @@
private static final int PING_VOLLEYS_PER_NETWORK_RECOMPUTE = 5;
//Atomic: Locking for both via secretsByPeer
- private final HashMap secretsByPeer=new HashMap();
- private final HashMap secretsByUID=new HashMap();
+ private final HashMap<PeerNode, StoredSecret> secretsByPeer = new
HashMap<PeerNode, StoredSecret>();
+ private final HashMap<Long, StoredSecret> secretsByUID = new
HashMap<Long, StoredSecret>();
//1.0 is disabled, this amounts to a threshold; if connectivity between
peers in > this, they get there own group for sure.
private static final double MAGIC_LINEAR_GRACE = 0.8;
@@ -137,9 +137,9 @@
} else {
byte[] nodeIdentity = ((ShortBuffer)
m.getObject(DMT.NODE_IDENTITY)).getData();
StoredSecret match;
- //Yes, I know... it looks really weird sync.ing on a
separate map...
+ //Yes, I know... it looks really weird sync'ing on a
separate map...
synchronized (secretsByPeer) {
- match=(StoredSecret)secretsByUID.get(new
Long(uid));
+ match = secretsByUID.get(uid);
}
if (match!=null) {
//This is the node that the ping intends to
reach, we will *not* forward it; but we might not respond positively either.
@@ -156,15 +156,15 @@
//Not a local match... forward
double target=m.getDouble(DMT.TARGET_LOCATION);
- HashSet routedTo=new HashSet();
- HashSet notIgnored=new HashSet();
+ HashSet<PeerNode> routedTo = new
HashSet<PeerNode>();
while (true) {
PeerNode next;
if (htl > dawnHtl &&
routedTo.isEmpty()) {
next=node.peers.getRandomPeer(source);
} else {
-
next=node.peers.closerPeer(source, routedTo, notIgnored, target, true,
node.isAdvancedModeEnabled(), -1, null, null);
+ next =
node.peers.closerPeer(source, routedTo, target, true,
node.isAdvancedModeEnabled(), -1,
+ null, null);
}
if (next==null) {
@@ -239,7 +239,7 @@
//FIXME: This needs to be wired in.
public void onDisconnect(PeerNode pn) {
synchronized (secretsByPeer) {
- StoredSecret s=(StoredSecret)secretsByPeer.get(pn);
+ StoredSecret s = secretsByPeer.get(pn);
if (s!=null) {
//???: Might it still be valid to respond to
secret pings when the neighbor requesting it has disconnected? (super-secret
ping?)
Logger.normal(this, "Removing on disconnect:
"+s);
@@ -250,7 +250,7 @@
private void addOrReplaceSecret(StoredSecret s) {
synchronized (secretsByPeer) {
- StoredSecret
prev=(StoredSecret)secretsByPeer.get(s.peer);
+ StoredSecret prev = secretsByPeer.get(s.peer);
if (prev!=null) {
if (logMINOR) Logger.minor(this, "Removing on
replacement: "+s);
removeSecret(prev);
@@ -258,7 +258,7 @@
//Need to remember by peer (so we can remove it on
disconnect)
//Need to remember by uid (so we can respond quickly to
arbitrary requests).
secretsByPeer.put(s.peer, s);
- secretsByUID.put(new Long(s.uid), s);
+ secretsByUID.put(s.uid, s);
}
}
@@ -363,7 +363,7 @@
}
@Override
public boolean equals(Object o) {
- return (o instanceof PeerNode ? via.equals((PeerNode)
o) : false);
+ return (o instanceof PeerNode ? via.equals(o) : false);
}
@Override
public int hashCode() {
@@ -372,20 +372,20 @@
}
//Directional lists of reachability, a "Map of Maps" of peers to
pingRecords.
- //This is asymetric; so recordsByPeer.get(a).get(b) [i.e. a's
reachability through peer b] may not
+ //This is asymmetric; so recordsByPeer.get(a).get(b) [i.e. a's
reachability through peer b] may not
//be nearly the same as recordsByPeer.get(b).get(a) [i.e. b's
reachability through peer a].
- private HashMap recordMapsByPeer=new HashMap();
+ private HashMap<PeerNode, HashMap<PeerNode, PingRecord>>
recordMapsByPeer = new HashMap<PeerNode, HashMap<PeerNode, PingRecord>>();
private PingRecord getPingRecord(PeerNode target, PeerNode via) {
PingRecord retval;
synchronized (recordMapsByPeer) {
- HashMap
peerRecords=(HashMap)recordMapsByPeer.get(target);
+ HashMap<PeerNode, PingRecord> peerRecords =
recordMapsByPeer.get(target);
if (peerRecords==null) {
//no record of any pings towards target
- peerRecords=new HashMap();
+ peerRecords = new HashMap<PeerNode,
PingRecord>();
recordMapsByPeer.put(target, peerRecords);
}
- retval=(PingRecord)peerRecords.get(via);
+ retval = peerRecords.get(via);
if (retval==null) {
//no records via this specific peer
retval=new PingRecord();
@@ -408,16 +408,14 @@
}
synchronized (recordMapsByPeer) {
recordMapsByPeer.remove(p);
- Iterator i=recordMapsByPeer.values().iterator();
- while (i.hasNext()) {
- HashMap complement=(HashMap)i.next();
+ for (HashMap<PeerNode, PingRecord> complement :
recordMapsByPeer.values()) {
//FIXME: NB: Comparing PeerNodes with
PingRecords.
complement.values().remove(p);
}
}
}
- private List workQueue=new ArrayList();
+ private List<PeerNode> workQueue = new ArrayList<PeerNode>();
private PeerNode processing;
private boolean processingRace;
private int pingVolleysToGo=PING_VOLLEYS_PER_NETWORK_RECOMPUTE;
@@ -434,20 +432,20 @@
return;
}
if (!workQueue.isEmpty())
- processing=(PeerNode)workQueue.remove(0);
+ processing = workQueue.remove(0);
}
if (processing!=null) {
PeerNode target=processing;
double randomTarget=node.random.nextDouble();
- HashSet nodesRoutedTo = new HashSet();
- PeerNode next = node.peers.closerPeer(target,
nodesRoutedTo, null, randomTarget, true, false, -1, null, null);
+ HashSet<PeerNode> nodesRoutedTo = new
HashSet<PeerNode>();
+ PeerNode next = node.peers.closerPeer(target,
nodesRoutedTo, randomTarget, true, false, -1, null, null);
while (next!=null && target.isRoutable() &&
!processingRace) {
nodesRoutedTo.add(next);
//the order is not that important, but for all
connected peers try to ping 'target'
blockingUpdatePingRecord(target, next);
//Since we are causing traffic to 'target'
betweenPingSleep(target);
- next = node.peers.closerPeer(target,
nodesRoutedTo, null, randomTarget, true, false, -1, null, null);
+ next = node.peers.closerPeer(target,
nodesRoutedTo, randomTarget, true, false, -1, null, null);
}
}
boolean didAnything;
@@ -565,21 +563,21 @@
}
public void checkAllPeers() {
- Iterator i=getAllConnectedPeers().iterator();
+ Set<PeerNode> set = getAllConnectedPeers();
synchronized (workQueue) {
- while (i.hasNext()) {
- addWorkToLockedQueue((PeerNode)i.next());
+ for (PeerNode p : set) {
+ addWorkToLockedQueue(p);
}
}
}
- private HashSet getAllConnectedPeers() {
+ private HashSet<PeerNode> getAllConnectedPeers() {
double randomTarget=node.random.nextDouble();
- HashSet connectedPeers = new HashSet();
- PeerNode next = node.peers.closerPeer(null, connectedPeers,
null, randomTarget, true, false, -1, null, null);
+ HashSet<PeerNode> connectedPeers = new HashSet<PeerNode>();
+ PeerNode next = node.peers.closerPeer(null, connectedPeers,
randomTarget, true, false, -1, null, null);
while (next!=null) {
connectedPeers.add(next);
- next = node.peers.closerPeer(null, connectedPeers,
null, randomTarget, true, false, -1, null, null);
+ next = node.peers.closerPeer(null, connectedPeers,
randomTarget, true, false, -1, null, null);
}
return connectedPeers;
}
@@ -593,9 +591,10 @@
private void doNetworkIDReckoning(boolean anyPingChanges) {
//!!!: This is where the magic separation logic begins.
// This may still need a lot of work; e.g. a locking mechanism,
considering disconnected peers?
- List newNetworkGroups=new ArrayList();
- HashSet all=getAllConnectedPeers();
- HashSet todo=(HashSet)all.clone();
+ List<PeerNetworkGroup> newNetworkGroups = new
ArrayList<PeerNetworkGroup>();
+ HashSet<PeerNode> all = getAllConnectedPeers();
+ @SuppressWarnings("unchecked")
+ HashSet<PeerNode> todo = (HashSet<PeerNode>) all.clone();
synchronized (transitionLock) {
inTransition=true;
@@ -614,10 +613,10 @@
PeerNetworkGroup newGroup = new PeerNetworkGroup();
newNetworkGroups.add(newGroup);
todo.remove(mostConnected);
- List members;
+ List<PeerNode> members;
if (todo.isEmpty()) {
//sad... it looks like this guy gets a group to
himself
- members=new ArrayList();
+ members = new ArrayList<PeerNode>();
members.add(mostConnected);
} else {
//NB: as a side effect, this function will
automatically remove the members from 'todo'.
@@ -629,24 +628,21 @@
//The groups are broken up, now sort by priority & assign them
a network id.
Collections.sort(newNetworkGroups, this);
- HashSet takenNetworkIds=new HashSet();
- Iterator i=newNetworkGroups.iterator();
+ HashSet<Integer> takenNetworkIds = new HashSet<Integer>();
- while (i.hasNext()) {
- PeerNetworkGroup newGroup=(PeerNetworkGroup)i.next();
+ for (PeerNetworkGroup newGroup : newNetworkGroups) {
newGroup.setForbiddenIds(takenNetworkIds);
int id=newGroup.getConsensus(true);
if (id==NO_NETWORKID)
id=node.random.nextInt();
newGroup.assignNetworkId(id);
- takenNetworkIds.add(new Integer(id));
+ takenNetworkIds.add(id);
if (logMINOR) Logger.minor(this, "net "+id+" has
"+newGroup.members.size()+" peers");
}
synchronized (transitionLock) {
- PeerNetworkGroup
ourgroup=(PeerNetworkGroup)newNetworkGroups.get(0);
- ourgroup.ourGroup=true;
+ PeerNetworkGroup ourgroup = newNetworkGroups.get(0);
ourNetworkId=ourgroup.networkid;
Logger.error(this, "I am in network: "+ourNetworkId+",
and have divided my "+all.size()+" peers into "+newNetworkGroups.size()+"
network groups");
@@ -661,13 +657,11 @@
}
// Returns the 'best-connected' peer in the given set, or null if the
set is empty.
- private PeerNode findMostConnectedPeerInSet(HashSet set, HashSet
possibleTargets) {
+ private PeerNode findMostConnectedPeerInSet(HashSet<PeerNode> set,
HashSet<PeerNode> possibleTargets) {
double max=-1.0;
PeerNode theMan=null;
- Iterator i=set.iterator();
- while (i.hasNext()) {
- PeerNode p=(PeerNode)i.next();
+ for (PeerNode p : set) {
double value=getPeerNodeConnectedness(p,
possibleTargets);
if (value>max) {
max=value;
@@ -679,12 +673,10 @@
}
// Return a double between [0.0-1.0] somehow indicating how
"wellconnected" this peer is to all the peers in possibleTargets.
- private double getPeerNodeConnectedness(PeerNode p, HashSet
possibleTargets) {
+ private double getPeerNodeConnectedness(PeerNode p, HashSet<PeerNode>
possibleTargets) {
double retval=1.0;
double totalLossFactor=1.0/possibleTargets.size();
- Iterator i=possibleTargets.iterator();
- while (i.hasNext()) {
- PeerNode target=(PeerNode)i.next();
+ for (PeerNode target : possibleTargets) {
PingRecord record=getPingRecord(p, target);
double pingAverage=record.average.currentValue();
if (pingAverage<totalLossFactor)
@@ -700,7 +692,7 @@
* side effect removes those peers from the set passed in. The set
includes at-least the
* given peer (will never return an empty list).
*/
- private List xferConnectedPeerSetFor(PeerNode thisPeer, HashSet
fromOthers) {
+ private List<PeerNode> xferConnectedPeerSetFor(PeerNode thisPeer,
HashSet<PeerNode> fromOthers) {
//FIXME: This algorithm needs to be thought about! Maybe some
hard thresholds.
// What recently-connected, peers who only have one or
two pings so far?
/*
@@ -710,10 +702,10 @@
the new forming group as the first peer is connected to
the original group.
Why? I don't know...
*/
- List currentGroup=new ArrayList();
+ List<PeerNode> currentGroup = new ArrayList<PeerNode>();
currentGroup.add(thisPeer);
//HashSet remainder=others.clone();
- HashSet remainder=fromOthers;
+ HashSet<PeerNode> remainder = fromOthers;
double goodConnectivity=getSetwisePingAverage(thisPeer,
fromOthers);
if (goodConnectivity < FALL_OPEN_MARK) {
Logger.normal(this, "falling open with
"+fromOthers.size()+" peers left");
@@ -737,7 +729,7 @@
}
//Exception! If there is only one left in fromOthers and we
have at least a 25% ping average make them be in the same network. This
probably means our algorithim is too picky (spliting up into too many groups).
if (currentGroup.size()==1 && fromOthers.size()==1) {
- PeerNode
onlyLeft=(PeerNode)fromOthers.iterator().next();
+ PeerNode onlyLeft = fromOthers.iterator().next();
double average1=getPingRecord(onlyLeft,
thisPeer).average.currentValue();
double average2=getPingRecord(thisPeer,
onlyLeft).average.currentValue();
if (0.5*average1+0.5*average2 > 0.25) {
@@ -749,32 +741,32 @@
return currentGroup;
}
- private double getSetwisePingAverage(PeerNode thisPeer, Collection
toThesePeers) {
- Iterator i=toThesePeers.iterator();
+ private double getSetwisePingAverage(PeerNode thisPeer,
Collection<PeerNode> toThesePeers) {
+ Iterator<PeerNode> i = toThesePeers.iterator();
double accum=0.0;
- if (!i.hasNext()) {
+ if (!i.hasNext()) { // FIXME this skip the first element,
investigate if is this intentional
//why yes, we have GREAT connectivity to nobody!
Logger.error(this, "getSetwisePingAverage to nobody?");
return 1.0;
}
while (i.hasNext()) {
- PeerNode other=(PeerNode)i.next();
+ PeerNode other = i.next();
accum+=getPingRecord(thisPeer,
other).average.currentValue();
}
return accum/toThesePeers.size();
}
- private PeerNode findBestSetwisePingAverage(HashSet ofThese, Collection
towardsThese) {
+ private PeerNode findBestSetwisePingAverage(HashSet<PeerNode> ofThese,
Collection<PeerNode> towardsThese) {
PeerNode retval=null;
double best=-1.0;
- Iterator i=ofThese.iterator();
- if (!i.hasNext()) {
+ Iterator<PeerNode> i = ofThese.iterator();
+ if (!i.hasNext()) { // FIXME this skip the first element,
investigate if is this intentional
//why yes, we have GREAT connectivity to nobody!
Logger.error(this, "findBestSetwisePingAverage to
nobody?");
return null;
}
while (i.hasNext()) {
- PeerNode thisOne=(PeerNode)i.next();
+ PeerNode thisOne = i.next();
double average=getSetwisePingAverage(thisOne,
towardsThese);
if (average>best) {
retval=thisOne;
@@ -817,10 +809,8 @@
//The forbidden ids is already set in this way, but if
we decide that one group needs to use the id of a lesser group, we must tell
the other group to use a different one; i.e. realign all the previous id's.
boolean haveFoundIt=false;
PeerNetworkGroup mine=p.networkGroup;
- Iterator i=networkGroups.iterator();
- HashSet nowTakenIds=new HashSet();
- while (i.hasNext()) {
- PeerNetworkGroup png=(PeerNetworkGroup)i.next();
+ HashSet<Integer> nowTakenIds = new HashSet<Integer>();
+ for (PeerNetworkGroup png : networkGroups) {
if (png.equals(mine)) {
haveFoundIt=true;
//should be the same:
png.setForbiddenIds(nowTakenIds);
@@ -846,21 +836,21 @@
}
}
//to continue means to realign all the
remaining forbidden ids.
- nowTakenIds.add(new Integer(newId));
+ nowTakenIds.add(newId);
} else if (haveFoundIt) {
//lower priority group, it may need to
be reset.
- //???: Should we take this oportunity
to always re-examine the consensus? This is a callback, so let's not.
+ //???: Should we take this opportunity
to always re-examine the consensus? This is a callback, so let's not.
png.setForbiddenIds(nowTakenIds);
int oldId=png.networkid;
int newId=oldId;
- if (nowTakenIds.contains(new
Integer(oldId))) {
+ if (nowTakenIds.contains(oldId)) {
newId=png.getConsensus(true);
png.assignNetworkId(newId);
}
- nowTakenIds.add(new Integer(newId));
+ nowTakenIds.add(newId);
} else {
//higher priority group, remember it's
id.
- nowTakenIds.add(new
Integer(png.networkid));
+ nowTakenIds.add(png.networkid);
}
}
}
@@ -870,10 +860,9 @@
A list of peers that we have assigned a network id to, and some logic
as to why.
*/
public class PeerNetworkGroup {
- List members;
+ List<PeerNode> members;
int networkid=NO_NETWORKID;
- boolean ourGroup;
- HashSet forbiddenIds;
+ HashSet<Integer> forbiddenIds;
long lastAssign;
///True if the last call to getConsensus() found only one
network id for all members of this group
boolean unanimous;
@@ -883,30 +872,28 @@
As a side effect, unanimous is set if there is only one
network id for all peers in this group.
@param probabilistic if true, may return any id from the set
with increased probability towards the greater consensus.
- @todo should be explict or weighted towards most-successful
(not neccesarily just 'consensus')
+ @todo should be explicit or weighted towards most-successful
(not necessarily just 'consensus')
*/
int getConsensus(boolean probabilistic) {
- HashMap h=new HashMap();
- Integer lastId=new Integer(networkid);
+ HashMap<Integer, Integer> h = new HashMap<Integer,
Integer>();
+ Integer lastId = networkid;
synchronized (this) {
- Iterator i=members.iterator();
int totalWitnesses=0;
int maxId=networkid;
int maxCount=0;
- while (i.hasNext()) {
- PeerNode p=(PeerNode)i.next();
- Integer id=new
Integer(p.providedNetworkID);
+ for (PeerNode p : members) {
+ Integer id = p.providedNetworkID;
//Reject the advertized id which
conflicts with our pre-determined boundaries (which can change)
if (forbiddenIds.contains(id))
continue;
- if (id.intValue()==NO_NETWORKID)
+ if (id == NO_NETWORKID)
continue;
totalWitnesses++;
int count=1;
- Integer prev=(Integer)h.get(id);
+ Integer prev = h.get(id);
if (prev!=null)
count=prev.intValue()+1;
- h.put(id, new Integer(count));
+ h.put(id, count);
if (count>maxCount) {
maxCount=count;
maxId=id.intValue();
@@ -928,11 +915,9 @@
double winningTarget=node.random.nextDouble();
if (logMINOR) Logger.minor(this,
"winningTarget="+winningTarget+", totalWitnesses="+totalWitnesses+",
inc="+incrementPerWitness);
double sum=0.0;
- Iterator entries=h.entrySet().iterator();
- while (entries.hasNext()) {
- Map.Entry e=(Map.Entry)entries.next();
- int id=((Integer)e.getKey()).intValue();
- int
count=((Integer)e.getValue()).intValue();
+ for (Map.Entry<Integer, Integer> e :
h.entrySet()) {
+ int id = e.getKey();
+ int count = e.getValue();
sum+=count*incrementPerWitness;
if (logMINOR) Logger.minor(this,
"network "+id+" "+count+" peers, "+sum);
if (sum>=winningTarget) {
@@ -947,9 +932,7 @@
synchronized (this) {
this.lastAssign=System.currentTimeMillis();
this.networkid=id;
- Iterator i=members.iterator();
- while (i.hasNext()) {
- PeerNode p=(PeerNode)i.next();
+ for (PeerNode p : members) {
p.assignedNetworkID=id;
p.networkGroup=this;
try {
@@ -963,17 +946,17 @@
/*
makes a copy of the given set of forbidden ids
*/
- void setForbiddenIds(HashSet a) {
+ void setForbiddenIds(HashSet<Integer> a) {
synchronized (this) {
- forbiddenIds=new HashSet(a);
+ forbiddenIds = new HashSet<Integer>(a);
}
}
/*
caveat, holds onto original list
*/
- void setMembers(List a) {
+ void setMembers(List<PeerNode> a) {
synchronized (this) {
- //more correct to copy, but presently
unneccesary.
+ //more correct to copy, but presently
unnecessary.
members=a;
}
}
@@ -983,7 +966,7 @@
}
//List of PeerNetworkGroups ordered by priority
- List networkGroups=new ArrayList();
+ List<PeerNetworkGroup> networkGroups = new
ArrayList<PeerNetworkGroup>();
//or zero if we don't know yet
public int ourNetworkId = NO_NETWORKID;
@@ -1008,9 +991,7 @@
* Orders PeerNetworkGroups by size largest first. Determines the
priority-order in the master list.
* Throws on comparison of non-network-groups or those without members
assigned.
*/
- public int compare(Object a1, Object b1) {
- PeerNetworkGroup a=(PeerNetworkGroup)a1;
- PeerNetworkGroup b=(PeerNetworkGroup)b1;
+ public int compare(PeerNetworkGroup a, PeerNetworkGroup b) {
//since we want largest-first, this is backwards of what it
would normally be (a-b).
return b.members.size()-a.members.size();
}
Modified: branches/db4o/freenet/src/freenet/node/Node.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/Node.java 2008-09-25 01:00:29 UTC
(rev 22831)
+++ branches/db4o/freenet/src/freenet/node/Node.java 2008-09-25 01:21:24 UTC
(rev 22832)
@@ -329,7 +329,7 @@
/** Datastore properties */
private final String storeType;
- private final int storeBloomFilterSize;
+ private int storeBloomFilterSize;
private final boolean storeBloomFilterCounting;
/** The number of bytes per key total in all the different datastores.
All the datastores
@@ -1382,7 +1382,7 @@
isAllowedToConnectToSeednodes =
opennetConfig.getBoolean("connectToSeednodes");
// Can be enabled on the fly
- opennetConfig.register("enabled", false, 0, false, true,
"Node.opennetEnabled", "Node.opennetEnabledLong", new BooleanCallback() {
+ opennetConfig.register("enabled", false, 0, true, true,
"Node.opennetEnabled", "Node.opennetEnabledLong", new BooleanCallback() {
@Override
public Boolean get() {
synchronized(Node.this) {
@@ -1626,7 +1626,7 @@
maxTotalKeys = maxTotalDatastoreSize / sizePerKey;
- nodeConfig.register("storeBloomFilterSize", (int)
Math.min(maxTotalDatastoreSize / 2048, 268435456), sortOrder++, true, false,
"Node.storeBloomFilterSize",
+ nodeConfig.register("storeBloomFilterSize", -1, sortOrder++,
true, false, "Node.storeBloomFilterSize",
"Node.storeBloomFilterSizeLong", new IntCallback() {
private Integer cachedBloomFilterSize;
@@ -1650,6 +1650,8 @@
});
storeBloomFilterSize =
nodeConfig.getInt("storeBloomFilterSize");
+ if (storeBloomFilterSize == -1)
+ storeBloomFilterSize = (int)
Math.min(maxTotalDatastoreSize / 2048, 268435456);
nodeConfig.register("storeBloomFilterCounting", true,
sortOrder++, true, false,
"Node.storeBloomFilterCounting",
"Node.storeBloomFilterCountingLong", new BooleanCallback() {
Modified: branches/db4o/freenet/src/freenet/node/NodeDispatcher.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/NodeDispatcher.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/NodeDispatcher.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -539,7 +539,6 @@
long accessTime;
PeerNode source;
final HashSet<PeerNode> routedTo;
- final HashSet<PeerNode> notIgnored;
Message msg;
short lastHtl;
final byte[] identity;
@@ -548,7 +547,6 @@
createdTime = accessTime = System.currentTimeMillis();
this.source = source;
routedTo = new HashSet<PeerNode>();
- notIgnored = new HashSet<PeerNode>();
this.msg = msg;
lastHtl = msg.getShort(DMT.HTL);
this.identity = identity;
@@ -690,7 +688,8 @@
next = null;
}
if(next == null)
- next = node.peers.closerPeer(pn, ctx.routedTo,
ctx.notIgnored, target, true, node.isAdvancedModeEnabled(), -1, null, null);
+ next = node.peers.closerPeer(pn, ctx.routedTo, target,
true, node.isAdvancedModeEnabled(), -1, null,
+ null);
if(logMINOR) Logger.minor(this, "Next: "+next+"
message: "+m);
if(next != null) {
// next is connected, or at least has been =>
next.getPeer() CANNOT be null.
Modified: branches/db4o/freenet/src/freenet/node/PacketSender.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/PacketSender.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/PacketSender.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -3,7 +3,6 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.node;
-import java.util.LinkedList;
import java.util.TreeMap;
import java.util.Vector;
@@ -42,7 +41,6 @@
/** We send connect attempts to old-opennet-peers no more than once
every
* this many milliseconds. */
static final int MIN_OLD_OPENNET_CONNECT_DELAY = 60 * 1000;
- final LinkedList resendPackets;
/** ~= Ticker :) */
private final TreeMap timedJobsByTime;
final NativeThread myThread;
@@ -68,7 +66,6 @@
}
PacketSender(Node node) {
- resendPackets = new LinkedList();
timedJobsByTime = new TreeMap();
this.node = node;
myThread = new NativeThread(this, "PacketSender thread for " +
node.getDarknetPortNumber(), NativeThread.MAX_PRIORITY, false);
Modified: branches/db4o/freenet/src/freenet/node/PeerManager.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/PeerManager.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/PeerManager.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -13,12 +13,12 @@
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;
-import java.util.ArrayList;
import freenet.io.comm.AsyncMessageCallback;
import freenet.io.comm.ByteCounter;
@@ -34,10 +34,8 @@
import freenet.support.Logger;
import freenet.support.ShortBuffer;
import freenet.support.SimpleFieldSet;
-import freenet.support.io.FileUtil;
import freenet.support.io.Closer;
-import java.util.SortedSet;
-import java.util.TreeSet;
+import freenet.support.io.FileUtil;
/**
* @author amphibian
@@ -815,15 +813,16 @@
return closestDist < nodeDist;
}
- public PeerNode closerPeer(PeerNode pn, Set routedTo, Set notIgnored,
double loc, boolean ignoreSelf, boolean calculateMisrouting, int minVersion,
Vector addUnpickedLocsTo, Key key) {
- return closerPeer(pn, routedTo, notIgnored, loc, ignoreSelf,
calculateMisrouting, minVersion, addUnpickedLocsTo, 2.0, key);
+ public PeerNode closerPeer(PeerNode pn, Set routedTo, double loc,
boolean ignoreSelf, boolean calculateMisrouting,
+ int minVersion, Vector addUnpickedLocsTo, Key key) {
+ return closerPeer(pn, routedTo, loc, ignoreSelf,
calculateMisrouting, minVersion, addUnpickedLocsTo, 2.0, key);
}
/**
* Find the peer, if any, which is closer to the target location than
we are, and is not included in the provided set.
* If ignoreSelf==false, and we are closer to the target than any
peers, this function returns null.
* This function returns two values, the closest such peer which is
backed off, and the same which is not backed off.
- * It is possible for either to be null independant of the other,
'closest' is the closer of the two in either case, and
+ * It is possible for either to be null independent of the other,
'closest' is the closer of the two in either case, and
* will not be null if any of the other two return values is not null.
* @param addUnpickedLocsTo Add all locations we didn't choose which we
could have routed to to
* this array. Remove the location of the peer we pick from it.
@@ -831,7 +830,8 @@
* @param key The original key, if we have it, and if we want to
consult with the FailureTable
* to avoid routing to nodes which have recently failed for the same
key.
*/
- public PeerNode closerPeer(PeerNode pn, Set routedTo, Set notIgnored,
double target, boolean ignoreSelf, boolean calculateMisrouting, int minVersion,
Vector addUnpickedLocsTo, double maxDistance, Key key) {
+ public PeerNode closerPeer(PeerNode pn, Set routedTo, double target,
boolean ignoreSelf,
+ boolean calculateMisrouting, int minVersion, Vector
addUnpickedLocsTo, double maxDistance, Key key) {
PeerNode[] peers;
synchronized(this) {
peers = connectedPeers;
@@ -875,7 +875,6 @@
long now = System.currentTimeMillis();
int count = 0;
- Long selectionSamplesTimestamp = now -
PeerNode.SELECTION_SAMPLING_PERIOD;
double[] selectionRates = new double[peers.length];
double totalSelectionRate = 0.0;
for(int i=0;i<peers.length;i++) {
Modified: branches/db4o/freenet/src/freenet/node/PeerNode.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/PeerNode.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/PeerNode.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -49,7 +49,6 @@
import freenet.io.comm.Peer;
import freenet.io.comm.PeerContext;
import freenet.io.comm.PeerParseException;
-import freenet.io.comm.PortForwardSensitiveSocketHandler;
import freenet.io.comm.ReferenceSignatureVerificationException;
import freenet.io.comm.SocketHandler;
import freenet.io.xfer.PacketThrottle;
@@ -65,7 +64,6 @@
import freenet.support.IllegalBase64Exception;
import freenet.support.LRUHashtable;
import freenet.support.Logger;
-import freenet.support.ShortBuffer;
import freenet.support.SimpleFieldSet;
import freenet.support.TimeUtil;
import freenet.support.WouldBlockException;
@@ -74,8 +72,6 @@
import freenet.support.math.TimeDecayingRunningAverage;
import freenet.support.transport.ip.HostnameSyntaxException;
import freenet.support.transport.ip.IPUtil;
-import java.util.SortedSet;
-import java.util.TreeSet;
/**
* @author amphibian
@@ -3723,8 +3719,6 @@
}
private boolean manyPacketsClaimedSentNotReceived = false;
- private long timeManyPacketsClaimedSentNotReceived;
-
synchronized boolean manyPacketsClaimedSentNotReceived() {
return manyPacketsClaimedSentNotReceived;
}
Modified: branches/db4o/freenet/src/freenet/node/RequestSender.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/RequestSender.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/RequestSender.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -448,7 +448,6 @@
int routeAttempts=0;
int rejectOverloads=0;
HashSet nodesRoutedTo = new HashSet();
- HashSet nodesNotIgnored = new HashSet();
PeerNode next = null;
while(true) {
/*
@@ -474,7 +473,8 @@
routeAttempts++;
// Route it
- next = node.peers.closerPeer(source, nodesRoutedTo,
nodesNotIgnored, target, true, node.isAdvancedModeEnabled(), -1, null, key);
+ next = node.peers.closerPeer(source, nodesRoutedTo, target, true,
node.isAdvancedModeEnabled(), -1, null,
+ key);
if(next == null) {
if (logMINOR && rejectOverloads>0)
Modified:
branches/db4o/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -101,7 +101,6 @@
int routeAttempts=0;
int rejectOverloads=0;
HashSet nodesRoutedTo = new HashSet();
- HashSet nodesNotIgnored = new HashSet();
while(true) {
if(logMINOR) Logger.minor(this, "htl="+htl);
if(htl == 0) {
@@ -113,7 +112,8 @@
// Route it
PeerNode next;
- next = node.peers.closerPeer(source, nodesRoutedTo,
nodesNotIgnored, target, true, node.isAdvancedModeEnabled(), -1, null, null);
+ next = node.peers.closerPeer(source, nodesRoutedTo, target, true,
node.isAdvancedModeEnabled(), -1, null,
+ null);
if(next == null) {
if (logMINOR && rejectOverloads>0)
Modified: branches/db4o/freenet/src/freenet/node/SSKInsertSender.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/SSKInsertSender.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/SSKInsertSender.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -121,7 +121,6 @@
private void realRun() {
HashSet nodesRoutedTo = new HashSet();
- HashSet nodesNotIgnored = new HashSet();
PeerNode next = null;
while(true) {
@@ -142,7 +141,8 @@
}
// Route it
- next = node.peers.closerPeer(source, nodesRoutedTo,
nodesNotIgnored, target, true, node.isAdvancedModeEnabled(), -1, null, null);
+ next = node.peers.closerPeer(source, nodesRoutedTo, target, true,
node.isAdvancedModeEnabled(), -1, null,
+ null);
if(next == null) {
// Backtrack
Modified: branches/db4o/freenet/src/freenet/node/Version.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/Version.java 2008-09-25 01:00:29 UTC
(rev 22831)
+++ branches/db4o/freenet/src/freenet/node/Version.java 2008-09-25 01:21:24 UTC
(rev 22832)
@@ -24,17 +24,17 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- private static final int buildNumber = 1162;
+ private static final int buildNumber = 1163;
/** Oldest build of Fred we will talk to */
- private static final int oldLastGoodBuild = 1160;
- private static final int newLastGoodBuild = 1162;
+ private static final int oldLastGoodBuild = 1162;
+ private static final int newLastGoodBuild = 1163;
static final long transitionTime;
static {
final Calendar _cal =
Calendar.getInstance(TimeZone.getTimeZone("GMT"));
// year, month - 1 (or constant), day, hour, minute, second
- _cal.set( 2008, Calendar.SEPTEMBER, 8, 0, 0, 0 );
+ _cal.set( 2008, Calendar.SEPTEMBER, 18, 0, 0, 0 );
transitionTime = _cal.getTimeInMillis();
}
Modified:
branches/db4o/freenet/src/freenet/node/simulator/BootstrapPullTest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/simulator/BootstrapPullTest.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/simulator/BootstrapPullTest.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -42,6 +42,7 @@
public static int EXIT_INSERT_FAILED = 259;
public static int EXIT_FETCH_FAILED = 260;
public static int EXIT_INSERTER_PROBLEM = 261;
+ public static int EXIT_THREW_SOMETHING = 262;
public static int DARKNET_PORT = 5004;
public static int OPENNET_PORT = 5005;
@@ -54,6 +55,8 @@
* @throws InterruptedException
*/
public static void main(String[] args) throws
InvalidThresholdException, IOException, NodeInitException, InterruptedException
{
+ Node secondNode = null;
+ try {
String ipOverride = null;
if(args.length > 0)
ipOverride = args[0];
@@ -97,7 +100,7 @@
FileUtil.writeTo(fis, new File(secondInnerDir, "seednodes.fref"));
fis.close();
PooledExecutor executor = new PooledExecutor();
- Node secondNode = NodeStarter.createTestNode(DARKNET_PORT,
OPENNET_PORT, dir.getPath(), true, false, false, Node.DEFAULT_MAX_HTL, 0,
random, executor, 1000, 5*1024*1024, true, true, true, true, true, true, true,
12*1024, false, true, ipOverride);
+ secondNode = NodeStarter.createTestNode(DARKNET_PORT, OPENNET_PORT,
dir.getPath(), true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor,
1000, 5*1024*1024, true, true, true, true, true, true, true, 12*1024, false,
true, ipOverride);
secondNode.start(true);
waitForTenNodes(secondNode);
@@ -116,7 +119,15 @@
System.out.println("RESULT: Fetch took
"+(endFetchTime-startFetchTime)+"ms
("+TimeUtil.formatTime(endFetchTime-startFetchTime)+") of "+uri+" .");
secondNode.park();
System.exit(0);
-
+ } catch (Throwable t) {
+ System.err.println("CAUGHT: "+t);
+ t.printStackTrace();
+ try {
+ if(secondNode != null)
+ secondNode.park();
+ } catch (Throwable t1) {};
+ System.exit(EXIT_THREW_SOMETHING);
+ }
}
private static FreenetURI insertData(File dataFile) throws IOException {
Modified:
branches/db4o/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/simulator/BootstrapPushPullTest.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -32,8 +32,12 @@
public static int EXIT_FAILED_TARGET = 258;
public static int EXIT_INSERT_FAILED = 259;
public static int EXIT_FETCH_FAILED = 260;
+ public static int EXIT_THREW_SOMETHING = 261;
public static void main(String[] args) throws
InvalidThresholdException, IOException, NodeInitException, InterruptedException
{
+ Node node = null;
+ Node secondNode = null;
+ try {
String ipOverride = null;
if(args.length > 0)
ipOverride = args[0];
@@ -52,7 +56,7 @@
fis.close();
// Create one node
Executor executor = new PooledExecutor();
- Node node = NodeStarter.createTestNode(5000, 5001, dir.getPath(),
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000,
5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, true,
ipOverride);
+ node = NodeStarter.createTestNode(5000, 5001, dir.getPath(), true,
false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 5*1024*1024,
true, true, true, true, true, true, true, 12*1024, false, true, ipOverride);
//NodeCrypto.DISABLE_GROUP_STRIP = true;
//Logger.setupStdoutLogging(Logger.MINOR,
"freenet:NORMAL,freenet.node.NodeDispatcher:MINOR,freenet.node.FNPPacketMangler:MINOR");
Logger.getChain().setThreshold(Logger.ERROR); // kill logging
@@ -94,7 +98,7 @@
FileUtil.writeTo(fis, new File(secondInnerDir, "seednodes.fref"));
fis.close();
executor = new PooledExecutor();
- Node secondNode = NodeStarter.createTestNode(5002, 5003,
dir.getPath(), true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor,
1000, 5*1024*1024, true, true, true, true, true, true, true, 12*1024, false,
true, ipOverride);
+ secondNode = NodeStarter.createTestNode(5002, 5003, dir.getPath(),
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000,
5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, true,
ipOverride);
secondNode.start(true);
waitForTenNodes(secondNode);
@@ -113,6 +117,20 @@
System.out.println("RESULT: Fetch took
"+(endFetchTime-startFetchTime)+"ms
("+TimeUtil.formatTime(endFetchTime-startFetchTime)+") of "+uri+" .");
secondNode.park();
System.exit(0);
+ } catch (Throwable t) {
+ System.err.println("CAUGHT: "+t);
+ t.printStackTrace();
+ try {
+ if(node != null)
+ node.park();
+ } catch (Throwable t1) {};
+ try {
+ if(secondNode != null)
+ secondNode.park();
+ } catch (Throwable t1) {};
+
+ System.exit(EXIT_THREW_SOMETHING);
+ }
}
private static void waitForTenNodes(Node node) throws
InterruptedException {
Modified:
branches/db4o/freenet/src/freenet/node/simulator/BootstrapSeedTest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/simulator/BootstrapSeedTest.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/simulator/BootstrapSeedTest.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -20,6 +20,7 @@
public static int TARGET_PEERS = 10;
public static int EXIT_NO_SEEDNODES = 257;
public static int EXIT_FAILED_TARGET = 258;
+ public static int EXIT_THREW_SOMETHING = 259;
/**
* @param args
@@ -29,6 +30,8 @@
* @throws IOException
*/
public static void main(String[] args) throws
InvalidThresholdException, NodeInitException, InterruptedException, IOException
{
+ Node node = null;
+ try {
String ipOverride = null;
if(args.length > 0)
ipOverride = args[0];
@@ -47,7 +50,7 @@
fis.close();
// Create one node
Executor executor = new PooledExecutor();
- Node node = NodeStarter.createTestNode(5000, 5001, "bootstrap-test",
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000,
5*1024*1024, true, true, true, true, true, true, true, 12*1024, false, true,
ipOverride);
+ node = NodeStarter.createTestNode(5000, 5001, "bootstrap-test", true,
false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000, 5*1024*1024,
true, true, true, true, true, true, true, 12*1024, false, true, ipOverride);
//NodeCrypto.DISABLE_GROUP_STRIP = true;
//Logger.setupStdoutLogging(Logger.MINOR,
"freenet:NORMAL,freenet.node.NodeDispatcher:MINOR,freenet.node.FNPPacketMangler:MINOR");
Logger.getChain().setThreshold(Logger.ERROR); // kill logging
@@ -75,6 +78,15 @@
System.err.println("Failed to reach target peers count
"+TARGET_PEERS+" in 5 minutes.");
node.park();
System.exit(EXIT_FAILED_TARGET);
+ } catch (Throwable t) {
+ System.err.println("CAUGHT: "+t);
+ t.printStackTrace();
+ try {
+ if(node != null)
+ node.park();
+ } catch (Throwable t1) {};
+ System.exit(EXIT_THREW_SOMETHING);
+ }
}
}
Modified: branches/db4o/freenet/src/freenet/node/simulator/SeednodePingTest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/simulator/SeednodePingTest.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/simulator/SeednodePingTest.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -43,12 +43,14 @@
static final long COUNT_SUCCESSES_PERIOD = 7*24*60*60*1000; // 1 week
public static void main(String[] args) throws FSParseException,
IOException, OpennetDisabledException, PeerParseException,
InterruptedException, ReferenceSignatureVerificationException,
NodeInitException, InvalidThresholdException {
+ Node node = null;
+ try {
if(args.length == 1)
STATUS_DIR = new File(args[0]);
RandomSource random = NodeStarter.globalTestInit("seednode-pingtest",
false, Logger.ERROR, "");
// Create one node
Executor executor = new PooledExecutor();
- Node node = NodeStarter.createTestNode(5000, 5001, "seednode-pingtest",
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000,
5*1024*1024, true, false, false, false, false, false, false, 0, false, false,
null);
+ node = NodeStarter.createTestNode(5000, 5001, "seednode-pingtest",
true, false, false, Node.DEFAULT_MAX_HTL, 0, random, executor, 1000,
5*1024*1024, true, false, false, false, false, false, false, 0, false, false,
null);
// Connect & ping
Vector<SeedServerTestPeerNode> seedNodes = new
Vector<SeedServerTestPeerNode>();
Vector<SimpleFieldSet> seedNodesAsSFS = Announcer.readSeednodes(new
File("/tmp/"));
@@ -179,5 +181,14 @@
}
node.park();
System.exit(0);
+ } catch (Throwable t) {
+ System.err.println("CAUGHT: "+t);
+ t.printStackTrace();
+ try {
+ if(node != null)
+ node.park();
+ } catch (Throwable t1) {};
+ System.exit(1);
}
+ }
}
Modified:
branches/db4o/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/node/useralerts/PeerManagerUserAlert.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -164,7 +164,7 @@
static public String replaceCareful(String text, String find, String
replace) {
String[] split = text.split(find, -1);
- StringBuilder sb = new StringBuilder(); // FIXME calculate size
+ StringBuilder sb = new StringBuilder(text.length() +
(split.length-1)*(replace.length() - find.length()));
for(int i=0;i<split.length;i++) {
sb.append(split[i]);
if(i < split.length - 1)
Modified: branches/db4o/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
===================================================================
--- branches/db4o/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -7,10 +7,7 @@
import freenet.support.Logger;
public class PluginInfoWrapper {
- // Parameters to make the object OTP
- @SuppressWarnings("unused")
- private boolean fedPluginThread = false;
- // Public since only PluginHandler will know about it
+
private final String className;
private Thread thread;
private final long start;
@@ -25,12 +22,13 @@
private final boolean isMultiplePlugin;
private final boolean isFCPPlugin;
private final boolean isVersionedPlugin;
+ private final boolean isThemedPlugin;
+ private final boolean isL10nPlugin;
+ private final boolean isUpdatedablePlugin;
private final String filename;
private HashSet<String> toadletLinks = new HashSet<String>();
private volatile boolean stopping = false;
private volatile boolean unregistered = false;
- private final boolean isThemedPlugin;
- private final boolean isL10nPlugin;
public PluginInfoWrapper(PluginRespirator pr, FredPlugin plug, String
filename) {
this.plug = plug;
@@ -39,7 +37,6 @@
this.pr = pr;
threadName = 'p' + className.replaceAll("^class ", "") + '_' +
hashCode();
start = System.currentTimeMillis();
- fedPluginThread = true;
isBandwidthIndicator = (plug instanceof
FredPluginBandwidthIndicator);
isPproxyPlugin = (plug instanceof FredPluginHTTP);
isThreadlessPlugin = (plug instanceof FredPluginThreadless);
@@ -50,6 +47,7 @@
isVersionedPlugin = (plug instanceof FredPluginVersioned);
isThemedPlugin = (plug instanceof FredPluginThemed);
isL10nPlugin = (plug instanceof FredPluginL10n);
+ isUpdatedablePlugin = (plug instanceof FredPluginUoF);
}
void setThread(Thread ps) {
@@ -190,9 +188,14 @@
public boolean isThemedPlugin() {
return isThemedPlugin;
}
+
public boolean isL10nPlugin() {
return isL10nPlugin;
}
+
+ public boolean isUpdatedablePlugin() {
+ return isUpdatedablePlugin;
+ }
public synchronized boolean isStopping() {
return stopping;
Modified:
branches/db4o/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
===================================================================
---
branches/db4o/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
2008-09-25 01:00:29 UTC (rev 22831)
+++
branches/db4o/freenet/src/freenet/store/saltedhash/SaltedHashFreenetStore.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -71,13 +71,9 @@
private final StoreCallback callback;
private final boolean collisionPossible;
private final int headerBlockLength;
- @SuppressWarnings("unused")
- private final int routeKeyLength;
private final int fullKeyLength;
private final int dataBlockLength;
private final Random random;
- @SuppressWarnings("unused")
- private UserAlertManager userAlertManager;
private long storeSize;
private int generation;
@@ -100,7 +96,6 @@
this.callback = callback;
collisionPossible = callback.collisionPossible();
- routeKeyLength = callback.routingKeyLength();
headerBlockLength = callback.headerLength();
fullKeyLength = callback.fullKeyLength();
dataBlockLength = callback.dataLength();
@@ -1430,8 +1425,6 @@
public void setUserAlertManager(UserAlertManager userAlertManager) {
if (cleanerStatusUserAlert != null)
userAlertManager.register(cleanerStatusUserAlert);
- // TODO change useralertmanager? is this a valid case?
- this.userAlertManager = userAlertManager;
}
public void setMaxKeys(long newStoreSize, boolean shrinkNow) throws
IOException {
Modified: branches/db4o/freenet/src/freenet/support/BloomFilter.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/BloomFilter.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/support/BloomFilter.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -20,7 +20,7 @@
protected ReadWriteLock lock = new ReentrantReadWriteLock();
public static BloomFilter createFilter(int length, int k, boolean
counting) {
- if (k == 0 || length == 0)
+ if (length == 0)
return new NullBloomFilter(length, k);
if (counting)
return new CountingBloomFilter(length, k);
@@ -29,7 +29,7 @@
}
public static BloomFilter createFilter(File file, int length, int k,
boolean counting) throws IOException {
- if (k == 0 || length == 0)
+ if (length == 0)
return new NullBloomFilter(length, k);
if (counting)
return new CountingBloomFilter(file, length, k);
@@ -154,12 +154,13 @@
* @param maxKey
* @return optimal K
*/
- // may return 0 if the length is too short
public static int optimialK(int filterLength, long maxKey) {
long k = Math.round(Math.log(2) * filterLength / maxKey);
if (k > 64)
k = 64;
+ if (k < 1)
+ k = 1;
return (int) k;
}
Modified: branches/db4o/freenet/src/freenet/support/DoublyLinkedList.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/DoublyLinkedList.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/support/DoublyLinkedList.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -63,10 +63,6 @@
*/
void unshift(DoublyLinkedList.Item<T> i);
/**
- * Put all items in the specified list before the first item.
- */
- void unshift(DoublyLinkedList<T> l);
- /**
* Removes and returns the first item.
*/
Item shift();
@@ -80,10 +76,6 @@
*/
void push(DoublyLinkedList.Item<T> i);
/**
- * Puts all items in the specified list after the last item.
- */
- void push(DoublyLinkedList<T> l);
- /**
* Removes and returns the last item.
*/
Item pop();
@@ -110,17 +102,9 @@
*/
void insertPrev(DoublyLinkedList.Item<T> i, DoublyLinkedList.Item<T> j);
/**
- * Inserts the entire {@link DoublyLinkedList} <code>l</code> before item
<code>i</code>.
- */
- void insertPrev(DoublyLinkedList.Item<T> i, DoublyLinkedList<T> l);
- /**
* Inserts item <code>j</code> after item <code>i</code.
*/
- void insertNext(DoublyLinkedList.Item<T> i, DoublyLinkedList.Item<T> j);
- /**
- * Inserts the entire {@link DoublyLinkedList} <code>l</code> after item
<code>i</code>.
- */
- void insertNext(DoublyLinkedList.Item<T> i, DoublyLinkedList<T> l);
+ void insertNext(DoublyLinkedList.Item<T> i, DoublyLinkedList.Item<T> j);
}
Modified: branches/db4o/freenet/src/freenet/support/DoublyLinkedListImpl.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/DoublyLinkedListImpl.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/support/DoublyLinkedListImpl.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -36,6 +36,13 @@
_tailptr = _t;
_headptr.setParent(this);
_tailptr.setParent(this);
+
+ DoublyLinkedList.Item i = _headptr;
+ while (i != null ) {
+ i.setParent(this);
+ i = i.getNext();
+ }
+
this.size = size;
}
@@ -133,14 +140,7 @@
/**
* {@inheritDoc}
- * FIXME: unimplemented
*/
- public void unshift(DoublyLinkedList<T> l) {
- throw new RuntimeException("function currently unimplemented because i
am a lazy sod");
- }
- /**
- * {@inheritDoc}
- */
public final DoublyLinkedList.Item<T> shift() {
return size == 0 ? null : remove(_headptr.next);
}
@@ -182,16 +182,10 @@
public final void push(DoublyLinkedList.Item<T> i) {
insertPrev(_tailptr, i);
}
+
/**
* {@inheritDoc}
- * FIXME: unimplemented
*/
- public void push(DoublyLinkedList<T> l) {
- throw new RuntimeException("function currently unimplemented because i
am a lazy sod");
- }
- /**
- * {@inheritDoc}
- */
public final DoublyLinkedList.Item<T> pop() {
return size == 0 ? null : remove(_tailptr.prev);
}
@@ -263,11 +257,8 @@
* {@inheritDoc}
*/
public DoublyLinkedList.Item<T> remove(DoublyLinkedList.Item<T> i) {
- if (i.getParent() == null) return null; // not in list
- if(isEmpty()) {
- Logger.error(this, "Illegal ERROR: Removing from an empty
list!!");
- throw new IllegalStateException("Illegal ERROR: Removing from
an empty list!!");
- }
+ if (i.getParent() == null || isEmpty())
+ return null; // not in list
if (i.getParent() != this)
throw new PromiscuousItemException(i, i.getParent());
DoublyLinkedList.Item<T> next = i.getNext(), prev = i.getPrev();
@@ -313,15 +304,7 @@
/**
* {@inheritDoc}
- * FIXME: unimplemented
*/
- public void insertPrev(DoublyLinkedList.Item<T> i, DoublyLinkedList<T> l) {
- throw new RuntimeException("function currently unimplemented because i
am a lazy sod");
- }
-
- /**
- * {@inheritDoc}
- */
public void insertNext(DoublyLinkedList.Item<T> i,
DoublyLinkedList.Item<T> j) {
if (i.getParent() != this)
throw new PromiscuousItemException(i, i.getParent());
@@ -340,15 +323,6 @@
++size;
}
- /**
- * {@inheritDoc}
- * FIXME: unimplemented
- */
- public void insertNext(DoublyLinkedList.Item<T> i, DoublyLinkedList<T> l) {
- throw new RuntimeException("function currently unimplemented because i
am a lazy sod");
- }
-
-
//=== Walkable implementation
==============================================
/**
Modified: branches/db4o/freenet/src/freenet/support/Fields.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/Fields.java 2008-09-25
01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/support/Fields.java 2008-09-25
01:21:24 UTC (rev 22832)
@@ -76,7 +76,7 @@
* input is nonnegative unless there is a preceding minus sign. This
method
* reads the input as twos complement instead, so if the input is 8
bytes
* long, it will correctly restore a negative long produced by
- * Long.toHexString() but not neccesarily one produced by
+ * Long.toHexString() but not necessarily one produced by
* Long.toString(x,16) since that method will produce a string like
'-FF'
* for negative longs values.
*
@@ -109,7 +109,7 @@
* input is nonnegative unless there is a preceding minus sign. This
method
* reads the input as twos complement instead, so if the input is 8
bytes
* long, it will correctly restore a negative int produced by
- * Integer.toHexString() but not neccesarily one produced by
+ * Integer.toHexString() but not necessarily one produced by
* Integer.toString(x,16) since that method will produce a string like
* '-FF' for negative integer values.
*
Modified: branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
===================================================================
--- branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
2008-09-25 01:00:29 UTC (rev 22831)
+++ branches/db4o/freenet/src/freenet/support/io/TempBucketFactory.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -147,11 +147,7 @@
}
private class TempBucketOutputStream extends OutputStream {
- @SuppressWarnings("unused")
- private final short idx;
-
TempBucketOutputStream(short idx) throws IOException {
- this.idx = idx;
if(os == null)
os = currentBucket.getOutputStream();
}
Modified:
branches/db4o/freenet/src/freenet/support/transport/ip/IPAddressDetector.java
===================================================================
---
branches/db4o/freenet/src/freenet/support/transport/ip/IPAddressDetector.java
2008-09-25 01:00:29 UTC (rev 22831)
+++
branches/db4o/freenet/src/freenet/support/transport/ip/IPAddressDetector.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -42,7 +42,6 @@
return System.currentTimeMillis() + interval; // We are pretty
cheap
}
- InetAddress lastInetAddress = null;
InetAddress[] lastAddressList = null;
long lastDetectedTime = -1;
@@ -80,7 +79,7 @@
} catch (SocketException e) {
Logger.error(
this,
- "SocketException trying to detect
NetworkInterfaces",
+ "SocketException trying to detect
NetworkInterfaces: "+e,
e);
addrs.add(oldDetect());
old = true;
Copied:
branches/db4o/freenet/test/freenet/support/DoublyLinkedListImplTest.java (from
rev 22610, trunk/freenet/test/freenet/support/DoublyLinkedListImplTest.java)
===================================================================
--- branches/db4o/freenet/test/freenet/support/DoublyLinkedListImplTest.java
(rev 0)
+++ branches/db4o/freenet/test/freenet/support/DoublyLinkedListImplTest.java
2008-09-25 01:21:24 UTC (rev 22832)
@@ -0,0 +1,425 @@
+package freenet.support;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+import junit.framework.TestCase;
+import freenet.support.DoublyLinkedListImpl.Item;
+
+public class DoublyLinkedListImplTest extends TestCase {
+ private static class T extends Item<T> {
+ int value;
+ boolean isClone;
+
+ T(int v) {
+ value = v;
+ }
+
+ @Override
+ public T clone() {
+ T c = new T(value);
+ c.isClone = true;
+ return c;
+ }
+
+ @Override
+ public String toString() {
+ if (isClone)
+ return "[" + value + "]";
+ else
+ return "(" + value + ")";
+ }
+
+ void assertV(int v) {
+ assertEquals(v, value);
+ }
+
+ public void assertIsClone() {
+ assertTrue("isClone", isClone);
+ }
+
+ public void assertIsNotClone() {
+ assertFalse("isClone", isClone);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o.getClass() != this.getClass())
+ return false;
+ T t = (T) o;
+ return t.value == value && t.isClone == isClone;
+ }
+
+ @Override
+ public int hashCode() {
+ return value;
+ }
+ }
+
+ public void testForwardPushPop() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ list.push(new T(0));
+ list.push(new T(1));
+ list.push(new T(2));
+ list.push(new T(3));
+
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.pop()).assertV(3);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.pop()).assertV(2);
+ assertFalse("isEmpty()", list.isEmpty());
+
+ // add again
+ list.push(new T(4));
+ list.push(new T(5));
+
+ ((T) list.pop()).assertV(5);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.pop()).assertV(4);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.pop()).assertV(1);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.pop()).assertV(0);
+
+ assertTrue("isEmpty()", list.isEmpty());
+ assertNull("pop()", list.pop());
+ }
+
+ public void testForwardShiftUnshift() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ list.unshift(new T(0));
+ list.unshift(new T(1));
+ list.unshift(new T(2));
+ list.unshift(new T(3));
+
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.shift()).assertV(3);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.shift()).assertV(2);
+ assertFalse("isEmpty()", list.isEmpty());
+
+ // add again
+ list.unshift(new T(4));
+ list.unshift(new T(5));
+
+ ((T) list.shift()).assertV(5);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.shift()).assertV(4);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.shift()).assertV(1);
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.shift()).assertV(0);
+
+ assertTrue("isEmpty()", list.isEmpty());
+ assertNull("shift()", list.shift());
+ }
+
+ public void testClearSize() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ list.unshift(new T(0));
+ list.unshift(new T(1));
+ list.unshift(new T(2));
+ list.unshift(new T(3));
+
+ assertEquals("size()", 4, list.size());
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.shift()).assertV(3);
+ assertEquals("size()", 3, list.size());
+ assertFalse("isEmpty()", list.isEmpty());
+ ((T) list.shift()).assertV(2);
+ assertEquals("size()", 2, list.size());
+ assertFalse("isEmpty()", list.isEmpty());
+
+ list.clear();
+
+ assertEquals("size()", 0, list.size());
+ assertTrue("isEmpty()", list.isEmpty());
+
+ // add again
+ list.unshift(new T(4));
+ list.unshift(new T(5));
+ assertEquals("size()", 2, list.size());
+ assertFalse("isEmpty()", list.isEmpty());
+
+ ((T) list.shift()).assertV(5);
+ ((T) list.shift()).assertV(4);
+
+ assertEquals("size()", 0, list.size());
+ assertTrue("isEmpty()", list.isEmpty());
+ }
+
+ public void testClone() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ for (int i = 0; i < 3; i++) {
+ list.unshift(new T(i));
+ }
+
+ DoublyLinkedList<T> listClone = list.clone();
+
+ for (int i = 2; i >= 0; i--) {
+ T t = (T) list.shift();
+ t.assertV(i);
+ t.assertIsNotClone();
+
+ T tc = (T) listClone.shift();
+ tc.assertV(i);
+ tc.assertIsClone();
+ }
+ }
+
+ public void testShiftN() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+
+ for (int i = 0; i < 5; i++) {
+ list.push(new T(i));
+ }
+
+ DoublyLinkedList<T> list2 = list.shift(2);
+ assertEquals("list2.size()", 2, list2.size());
+ ((T) list2.shift()).assertV(0);
+ ((T) list2.shift()).assertV(1);
+ assertTrue("list2.isEmpty()", list2.isEmpty());
+
+ assertEquals("list.size()", 3, list.size());
+ ((T) list.shift()).assertV(2);
+
+ list2 = list.shift(20);
+ assertTrue("list.isEmpty()", list.isEmpty());
+ ((T) list2.shift()).assertV(3);
+ ((T) list2.shift()).assertV(4);
+ assertTrue("list2.isEmpty()", list2.isEmpty());
+
+ list2 = list.shift(20);
+ assertTrue("list2.isEmpty()", list2.isEmpty());
+ }
+
+ public void testPopN() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+
+ for (int i = 0; i < 5; i++) {
+ list.unshift(new T(i));
+ }
+
+ DoublyLinkedList<T> list2 = list.pop(2);
+ assertEquals("list2.size()", 2, list2.size());
+ ((T) list2.pop()).assertV(0);
+ ((T) list2.pop()).assertV(1);
+ assertTrue("list2.isEmpty()", list2.isEmpty());
+
+ assertEquals("list.size()", 3, list.size());
+ ((T) list.pop()).assertV(2);
+
+ list2 = list.pop(20);
+ assertTrue("list.isEmpty()", list.isEmpty());
+ ((T) list2.pop()).assertV(3);
+ ((T) list2.pop()).assertV(4);
+ assertTrue("list2.isEmpty()", list2.isEmpty());
+
+ list2 = list.pop(20);
+ assertTrue("list2.isEmpty()", list2.isEmpty());
+ }
+
+ public void testHeadTail() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+
+ assertNull("head() == null", list.head());
+ assertNull("tail() == null", list.tail());
+
+ T[] array = new T[5];
+ for (int i = 0; i < 5; i++) {
+ array[i] = new T(i);
+ list.push(array[i]);
+ }
+
+ assertTrue("head() == 0", array[0] == list.head());
+ assertTrue("tail() == 4", array[4] == list.tail());
+
+ list.shift();
+ assertTrue("head() == 1", array[1] == list.head());
+ assertTrue("tail() == 4", array[4] == list.tail());
+
+ list.pop();
+ assertTrue("head() == 1", array[1] == list.head());
+ assertTrue("tail() == 3", array[3] == list.tail());
+
+ list.clear();
+
+ assertNull("head() == null", list.head());
+ assertNull("tail() == null", list.tail());
+ }
+
+ public void testIternator() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ T[] array = new T[5];
+
+ for (int i = 0; i < 5; i++) {
+ array[i] = new T(i);
+ list.push(array[i]);
+ }
+
+ // manual, forward
+ T h = (T) list.head();
+ for (int i = 0; i < 5; i++) {
+ assertEquals("manual iternate, forward", array[i], h);
+ //assertEquals("DoublyLinkedList.next() ==
Item.next()", h.getNext(), list.next(h));
+ assertEquals("hasNext()", i != 4, list.hasNext(h));
+ assertEquals("hasPrev()", i != 0, list.hasPrev(h));
+
+ h.assertV(i);
+
+ h = (T) list.next(h);
+ }
+ assertEquals("h==null", null, h);
+
+ // manual, reverse
+ T t = (T) list.tail();
+ for (int i = 4; i >= 0; i--) {
+ assertEquals("manual iternate, reverse", array[i], t);
+ //assertEquals("DoublyLinkedList.prev() ==
Item.getPrev()", tail.getPrev(), list.prev(tail));
+ assertEquals("hasNext()", i != 4, list.hasNext(t));
+ assertEquals("hasPrev()", i != 0, list.hasPrev(t));
+
+ t.assertV(i);
+
+ t = (T) list.prev(t);
+ }
+ assertNull("t==null", t);
+
+ Enumeration<T> e = list.elements();
+ for (int i = 0; i < 5; i++) {
+ assertTrue("hasMoreElements()", e.hasMoreElements());
+
+ T n = e.nextElement();
+ n.assertV(i);
+
+ assertEquals("hasMoreElements()", i != 4,
e.hasMoreElements());
+ }
+ try {
+ e.nextElement();
+ fail("NoSuchElementException");
+ } catch (NoSuchElementException nsee) {
+ }
+ }
+
+ public void testRandomRemovePush() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ T[] array = new T[5];
+
+ for (int i = 0; i < 5; i++) {
+ array[i] = new T(i);
+ list.push(array[i]);
+ }
+
+ assertTrue(list.remove(array[3]) == array[3]);
+ list.push(array[3]);
+
+ // Remove non-exist item -> give null
+ assertNull(list.remove(new T(-1)));
+
+ // Remove non-identical (but equal) item -> give null
+ assertNull(list.remove(new T(2)));
+
+ ((T) list.shift()).assertV(0);
+ ((T) list.shift()).assertV(1);
+ ((T) list.shift()).assertV(2);
+ ((T) list.shift()).assertV(4);
+ ((T) list.shift()).assertV(3);
+
+ assertNull(list.remove(new T(-1)));
+ }
+
+ public void testRandomShiftPush() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ list.push(new T(0));
+ list.push(new T(1));
+ list.unshift(new T(2));
+ list.push(new T(3));
+ list.unshift(new T(4));
+ list.unshift(new T(5));
+
+ ((T) list.shift()).assertV(5);
+ ((T) list.pop()).assertV(3);
+ ((T) list.pop()).assertV(1);
+ ((T) list.pop()).assertV(0);
+ ((T) list.shift()).assertV(4);
+ ((T) list.shift()).assertV(2);
+ }
+
+ public void testRandomInsert() {
+ DoublyLinkedList<T> list = new DoublyLinkedListImpl<T>();
+ T[] array = new T[5];
+
+ for (int i = 0; i < 5; i++) {
+ array[i] = new T(i);
+ list.push(array[i]);
+ }
+
+ list.insertPrev(array[0], new T(100));
+ list.insertPrev(array[2], new T(102));
+ list.insertNext(array[4], new T(104));
+ list.insertNext(array[4], new T(105));
+
+ DoublyLinkedList<T> list2 = new DoublyLinkedListImpl<T>();
+ T l2 = new T(9999);
+ list2.push(l2);
+ try {
+ // already exist
+ list2.insertNext(l2, l2);
+ fail("PromiscuousItemException");
+ } catch (PromiscuousItemException pie) {
+ }
+ try {
+ // already exist
+ list2.insertNext(l2, l2);
+ fail("PromiscuousItemException");
+ } catch (PromiscuousItemException pie) {
+ }
+ try {
+ // bad position
+ list2.insertPrev(array[3], new T(8888));
+ fail("PromiscuousItemException");
+ } catch (PromiscuousItemException pie) {
+ }
+ try {
+ // bad position
+ list2.insertNext(array[3], new T(8888));
+ fail("PromiscuousItemException");
+ } catch (PromiscuousItemException pie) {
+ }
+ try {
+ // item in other list
+ list2.insertPrev(l2, array[3]);
+ fail("PromiscuousItemException");
+ } catch (PromiscuousItemException pie) {
+ }
+ try {
+ // item in other list
+ list2.insertNext(l2, array[3]);
+ fail("PromiscuousItemException");
+ } catch (PromiscuousItemException pie) {
+ }
+ try {
+ // VirginItemException
+ list2.insertPrev(l2.getPrev(), new T(8888));
+ fail("PromiscuousItemException");
+ } catch (VirginItemException vie) {
+ }
+ try {
+ // VirginItemException
+ list2.insertNext(l2.getNext(), new T(8888));
+ fail("VirginItemException");
+ } catch (VirginItemException vie) {
+ }
+
+ ((T) list.shift()).assertV(100);
+ ((T) list.shift()).assertV(0);
+ ((T) list.shift()).assertV(1);
+ ((T) list.shift()).assertV(102);
+ ((T) list.shift()).assertV(2);
+ ((T) list.shift()).assertV(3);
+ ((T) list.shift()).assertV(4);
+ ((T) list.shift()).assertV(105);
+ ((T) list.shift()).assertV(104);
+
+ }
+}