Author: dbkr
Date: 2006-05-27 22:27:31 +0000 (Sat, 27 May 2006)
New Revision: 8888
Modified:
trunk/freenet/src/freenet/clients/http/PageMaker.java
trunk/freenet/src/freenet/clients/http/filter/HTMLFilter.java
trunk/freenet/src/freenet/node/fcp/FCPServer.java
trunk/freenet/src/net/i2p/util/NativeBigInteger.java
Log:
Changes to allow compilation on more finicky compilers, and one to improve
compatability with GCJ.
Modified: trunk/freenet/src/freenet/clients/http/PageMaker.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PageMaker.java 2006-05-27
22:05:06 UTC (rev 8887)
+++ trunk/freenet/src/freenet/clients/http/PageMaker.java 2006-05-27
22:27:31 UTC (rev 8888)
@@ -105,6 +105,11 @@
List themes = new ArrayList();
try {
URL url = getClass().getResource("staticfiles/themes/");
+ // This seems not to work with GCJ, as it returns null.
Try another method.
+ if (url == null) {
+ url = new URL("staticfiles/themes/");
+ if (url == null) throw new IOException("Can't
find themes");
+ }
URLConnection urlConnection = url.openConnection();
if (url.getProtocol().equals("file")) {
File themesDirectory = new
File(URLDecoder.decode(url.getPath(), "ISO-8859-1").replaceAll("\\|", ":"));
Modified: trunk/freenet/src/freenet/clients/http/filter/HTMLFilter.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/filter/HTMLFilter.java
2006-05-27 22:05:06 UTC (rev 8887)
+++ trunk/freenet/src/freenet/clients/http/filter/HTMLFilter.java
2006-05-27 22:27:31 UTC (rev 8888)
@@ -516,7 +516,7 @@
Logger.minor(this, "Element = "+element);
}
- public ParsedTag sanitize(HTMLParseContext pc) throws
DataFilterException {
+ public ParsedTag
sanitize(freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) throws
DataFilterException {
TagVerifier tv =
(TagVerifier)
allowedTagsVerifiers.get(element.toLowerCase());
Logger.minor(this, "Got verifier: "+tv+" for "+element);
@@ -1109,7 +1109,7 @@
}
}
- ParsedTag sanitize(ParsedTag t, HTMLParseContext pc) throws
DataFilterException {
+ ParsedTag sanitize(ParsedTag t,
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) throws
DataFilterException {
Hashtable h = new Hashtable();
boolean equals = false;
String prevX = "";
@@ -1179,7 +1179,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = new Hashtable();
for (Enumeration e = h.keys(); e.hasMoreElements();) {
String x = (String) e.nextElement();
@@ -1249,16 +1249,16 @@
super(tag, allowedAttrs, uriAttrs);
}
- abstract void setStyle(boolean b, HTMLParseContext pc);
+ abstract void setStyle(boolean b,
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc);
- abstract boolean getStyle(HTMLParseContext pc);
+ abstract boolean
getStyle(freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc);
- abstract void processStyle(HTMLParseContext pc);
+ abstract void
processStyle(freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc);
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
if (p.startSlash) {
return finish(h, hn, pc);
@@ -1270,7 +1270,7 @@
Hashtable finish(
Hashtable h,
Hashtable hn,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Logger.minor(this, "Finishing script/style");
// Finishing
setStyle(false, pc);
@@ -1295,7 +1295,7 @@
return hn;
}
- Hashtable start(Hashtable h, Hashtable hn, HTMLParseContext pc)
throws DataFilterException {
+ Hashtable start(Hashtable h, Hashtable hn,
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) throws
DataFilterException {
Logger.minor(this, "Starting script/style");
pc.styleScriptRecurseCount++;
if (pc.styleScriptRecurseCount > 1) {
@@ -1329,15 +1329,15 @@
emptyStringArray);
}
- void setStyle(boolean b, HTMLParseContext pc) {
+ void setStyle(boolean b,
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
pc.inStyle = b;
}
- boolean getStyle(HTMLParseContext pc) {
+ boolean
getStyle(freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
return pc.inStyle;
}
- void processStyle(HTMLParseContext pc) {
+ void
processStyle(freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
try {
pc.currentStyleScriptChunk =
sanitizeStyle(pc.currentStyleScriptChunk, pc.cb);
@@ -1369,21 +1369,21 @@
Hashtable sanitizeHash(
Hashtable hn,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
// Call parent so we swallow the scripting
Hashtable h = super.sanitizeHash(hn, p, pc);
return null; // Lose the tags
}
- void setStyle(boolean b, HTMLParseContext pc) {
+ void setStyle(boolean b,
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
pc.inScript = b;
}
- boolean getStyle(HTMLParseContext pc) {
+ boolean
getStyle(freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
return pc.inScript;
}
- void processStyle(HTMLParseContext pc) {
+ void
processStyle(freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
pc.currentStyleScriptChunk =
sanitizeScripting(pc.currentStyleScriptChunk);
}
@@ -1400,7 +1400,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
// %i18n dealt with by TagVerifier
// %coreattrs
@@ -1490,7 +1490,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
// events (default and added)
for (Iterator e = eventAttrs.iterator(); e.hasNext();) {
@@ -1519,7 +1519,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
String hreflang = getHashString(h, "hreflang");
String charset = null;
@@ -1599,7 +1599,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
// Action has been previously sanitized, we force it :p
hn.put("action","/");
@@ -1639,7 +1639,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
// We drop the whole <input> if type isn't allowed
@@ -1659,7 +1659,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
/*
* Several possibilities: a) meta http-equiv=X
content=Y b) meta
@@ -1764,7 +1764,7 @@
DTDs.put("-//W3C//DTD HTML 3.2 Final//EN", new
Object());
}
- ParsedTag sanitize(ParsedTag t, HTMLParseContext pc) {
+ ParsedTag sanitize(ParsedTag t,
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
if (!(t.unparsedAttrs.length == 3 ||
t.unparsedAttrs.length == 4))
return null;
if (!t.unparsedAttrs[0].equalsIgnoreCase("html"))
@@ -1789,7 +1789,7 @@
super("?xml", null);
}
- ParsedTag sanitize(ParsedTag t, HTMLParseContext pc) {
+ ParsedTag sanitize(ParsedTag t,
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) {
if (t.unparsedAttrs.length != 2)
return null;
if (!t.unparsedAttrs[0].equals("version=\"1.0\""))
@@ -1814,7 +1814,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException {
+ freenet.clients.http.filter.HTMLFilter.HTMLParseContext
pc) throws DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
String xmlns = getHashString(h, "xmlns");
if (xmlns != null &&
xmlns.equals("http://www.w3.org/1999/xhtml"))
@@ -1832,7 +1832,7 @@
Hashtable sanitizeHash(
Hashtable h,
ParsedTag p,
- HTMLParseContext pc) throws DataFilterException
{
+
freenet.clients.http.filter.HTMLFilter.HTMLParseContext pc) throws
DataFilterException {
Hashtable hn = super.sanitizeHash(h, p, pc);
// Get the already-sanitized version.
String baseHref = getHashString(hn, "href");
Modified: trunk/freenet/src/freenet/node/fcp/FCPServer.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPServer.java 2006-05-27 22:05:06 UTC
(rev 8887)
+++ trunk/freenet/src/freenet/node/fcp/FCPServer.java 2006-05-27 22:27:31 UTC
(rev 8888)
@@ -105,15 +105,15 @@
Logger.normal(this, "Starting FCP server on
"+bindTo+":"+port+".");
System.out.println("Starting FCP server on
"+bindTo+":"+port+".");
- NetworkInterface networkInterface = null;
+ NetworkInterface netInterface = null;
try {
- networkInterface = new NetworkInterface(port,
bindTo, allowedHosts);
+ netInterface = new NetworkInterface(port,
bindTo, allowedHosts);
} catch (BindException be) {
Logger.error(this, "Couldn't bind to FCP Port
"+bindTo+":"+port+". FCP Server not started.");
System.out.println("Couldn't bind to FCP Port
"+bindTo+":"+port+". FCP Server not started.");
}
- this.networkInterface = networkInterface;
+ this.networkInterface = netInterface;
if (this.networkInterface != null) {
Thread t = new Thread(this, "FCP server");
@@ -272,7 +272,7 @@
public void set(long value) {
server.persistenceInterval = value;
- FCPServerPersister p = server.persister;
+ freenet.node.fcp.FCPServer.FCPServerPersister p =
server.persister;
if(p != null) {
synchronized(p) {
p.notify();
Modified: trunk/freenet/src/net/i2p/util/NativeBigInteger.java
===================================================================
--- trunk/freenet/src/net/i2p/util/NativeBigInteger.java 2006-05-27
22:05:06 UTC (rev 8887)
+++ trunk/freenet/src/net/i2p/util/NativeBigInteger.java 2006-05-27
22:27:31 UTC (rev 8888)
@@ -585,4 +585,11 @@
else
return "lib";
}
+
+ public int compareTo(Object obj) {
+ if (obj instanceof BigInteger) {
+ return super.compareTo((BigInteger)obj);
+ }
+ return -1;
+ }
}