[freenet-cvs] r19727 - in trunk/freenet/src/freenet: clients/http clients/http/filter crypt frost/message keys node node/fcp support support/compress

j16sdiz at freenetproject.org j16sdiz at freenetproject.org
Sun May 4 10:32:33 UTC 2008


Author: j16sdiz
Date: 2008-05-04 10:32:33 +0000 (Sun, 04 May 2008)
New Revision: 19727

Modified:
   trunk/freenet/src/freenet/clients/http/HTTPRequestImpl.java
   trunk/freenet/src/freenet/clients/http/QueueToadlet.java
   trunk/freenet/src/freenet/clients/http/Spider.java
   trunk/freenet/src/freenet/clients/http/Toadlet.java
   trunk/freenet/src/freenet/clients/http/filter/GenericReadFilterCallback.java
   trunk/freenet/src/freenet/clients/http/filter/JPEGFilter.java
   trunk/freenet/src/freenet/crypt/Yarrow.java
   trunk/freenet/src/freenet/frost/message/FrostMessage.java
   trunk/freenet/src/freenet/keys/ClientKSK.java
   trunk/freenet/src/freenet/keys/ClientSSK.java
   trunk/freenet/src/freenet/node/DarknetPeerNode.java
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
   trunk/freenet/src/freenet/node/NodeARKInserter.java
   trunk/freenet/src/freenet/node/NodeCrypto.java
   trunk/freenet/src/freenet/node/PeerManager.java
   trunk/freenet/src/freenet/node/PeerNode.java
   trunk/freenet/src/freenet/node/SSKInsertHandler.java
   trunk/freenet/src/freenet/node/fcp/ClientPut.java
   trunk/freenet/src/freenet/node/fcp/PeerNote.java
   trunk/freenet/src/freenet/support/SimpleFieldSet.java
   trunk/freenet/src/freenet/support/URIPreEncoder.java
   trunk/freenet/src/freenet/support/URLDecoder.java
   trunk/freenet/src/freenet/support/URLEncoder.java
   trunk/freenet/src/freenet/support/compress/GzipCompressor.java
Log:
revert r19726


Modified: trunk/freenet/src/freenet/clients/http/HTTPRequestImpl.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/HTTPRequestImpl.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/clients/http/HTTPRequestImpl.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -203,7 +203,7 @@
 						name = URLDecoder.decode(name, "UTF-8");
 						value = URLDecoder.decode(value, "UTF-8");
 					} catch (UnsupportedEncodingException e) {
-						throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+						throw new Error(e);
 					}
 				if(logMINOR) {
 					Logger.minor(this, "Decoded name: "+name);
@@ -217,7 +217,7 @@
 				try {
 					buf = value.getBytes("UTF-8");
 				} catch (UnsupportedEncodingException e) {
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+					throw new Error(e);
 				} // FIXME some other encoding?
 				Bucket b = new SimpleReadOnlyArrayBucket(buf);
 				parts.put(name, b);
@@ -564,8 +564,9 @@
 		try {
 			return new String(getPartAsBytes(name, maxlength), "UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			/* UTF-8 is always supported. */
 		}
+		return null;
 	}
 
 	/* (non-Javadoc)

Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -1161,7 +1161,7 @@
 			// Normal
 			return false;
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new RuntimeException(e);
 		} catch (IOException e) {
 			Logger.error(this, "Could not read completed identifiers list from "+file);
 			return false;

Modified: trunk/freenet/src/freenet/clients/http/Spider.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/Spider.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/clients/http/Spider.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -243,7 +243,7 @@
 		try {
 			osw = new OutputStreamWriter(fos, "UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error(e);
 		}
 		
 		if (urisByWord.isEmpty() || urisWithWords.isEmpty()) {

Modified: trunk/freenet/src/freenet/clients/http/Toadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/Toadlet.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/clients/http/Toadlet.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -186,7 +186,8 @@
 		try {
 			buf = redirDoc.getBytes("UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			// No way!
+			throw new Error(e);
 		}
 		ctx.sendReplyHeaders(301, "Moved Permanently", mvt, "text/html; charset=UTF-8", buf.length);
 		ctx.writeData(buf, 0, buf.length);
@@ -206,7 +207,8 @@
 		try {
 			buf = redirDoc.getBytes("UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			// No way!
+			throw new Error(e);
 		}
 		ctx.sendReplyHeaders(302, "Found", mvt, "text/html; charset=UTF-8", buf.length);
 		ctx.writeData(buf, 0, buf.length);

Modified: trunk/freenet/src/freenet/clients/http/filter/GenericReadFilterCallback.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/filter/GenericReadFilterCallback.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/clients/http/filter/GenericReadFilterCallback.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -239,7 +239,6 @@
 				// FIXME encode it properly
 					p += URLEncoder.encode(u.getFragment(),"UTF-8");
 				}catch (UnsupportedEncodingException e1){
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
 				}
 			}
 			return p;

Modified: trunk/freenet/src/freenet/clients/http/filter/JPEGFilter.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/filter/JPEGFilter.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/clients/http/filter/JPEGFilter.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -370,7 +370,7 @@
 			baos.write(data);
 			baos.write(0);
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support ISO-8859-1: " + e, e);
+			throw new Error(e);
 		}
 	}
 

Modified: trunk/freenet/src/freenet/crypt/Yarrow.java
===================================================================
--- trunk/freenet/src/freenet/crypt/Yarrow.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/crypt/Yarrow.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -739,7 +739,7 @@
 		try {
 			b = str.getBytes("UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error(e);
 		}
 		consumeBytes(b);
 	}

Modified: trunk/freenet/src/freenet/frost/message/FrostMessage.java
===================================================================
--- trunk/freenet/src/freenet/frost/message/FrostMessage.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/frost/message/FrostMessage.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -283,7 +283,7 @@
 		try {
 			data = this.getXml().getBytes("UTF-8");
 		} catch (UnsupportedEncodingException e1) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e1, e1);
+			throw new Error(e1);
 		}
     	InsertBlock block = null;
     	

Modified: trunk/freenet/src/freenet/keys/ClientKSK.java
===================================================================
--- trunk/freenet/src/freenet/keys/ClientKSK.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/keys/ClientKSK.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -40,7 +40,7 @@
 			try {
 				keywordHash = md256.digest(keyword.getBytes("UTF-8"));
 			} catch (UnsupportedEncodingException e) {
-				throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+				throw new Error(e);
 			}
 			MersenneTwister mt = new MersenneTwister(keywordHash);
 			DSAPrivateKey privKey = new DSAPrivateKey(Global.DSAgroupBigA, mt);

Modified: trunk/freenet/src/freenet/keys/ClientSSK.java
===================================================================
--- trunk/freenet/src/freenet/keys/ClientSSK.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/keys/ClientSSK.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -63,7 +63,7 @@
 			try {
 				md.update(docName.getBytes("UTF-8"));
 			} catch (UnsupportedEncodingException e) {
-				throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+				throw new Error(e);
 			}
 			byte[] buf = md.digest();
 			try {

Modified: trunk/freenet/src/freenet/node/DarknetPeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/DarknetPeerNode.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/DarknetPeerNode.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -411,7 +411,7 @@
 		try {
 			isr = new InputStreamReader(fis, "UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error("Impossible: JVM doesn't support UTF-8: "+e, e);
 		}
 		BufferedReader br = new BufferedReader(isr);
 		SimpleFieldSet fs = null;
@@ -503,7 +503,7 @@
 					n2nm = DMT.createNodeToNodeMessage(type, fs.toString().getBytes("UTF-8"));
 				} catch (UnsupportedEncodingException e) {
 					Logger.error(this, "UnsupportedEncodingException processing extraPeerDataType ("+extraPeerDataTypeString+") in file "+extraPeerDataFile.getPath(), e);
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+					return false;
 				}
 
 				try {
@@ -578,7 +578,7 @@
 		try {
 			w = new OutputStreamWriter(fos, "UTF-8");
 		} catch (UnsupportedEncodingException e2) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e2, e2);
+			throw new Error("UTF-8 unsupported!: "+e2, e2);
 		}
 		BufferedWriter bw = new BufferedWriter(w);
 		try {
@@ -676,7 +676,7 @@
 		try {
 			w = new OutputStreamWriter(fos, "UTF-8");
 		} catch (UnsupportedEncodingException e2) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e2, e2);
+			throw new Error("JVM doesn't support UTF-8 charset!: "+e2, e2);
 		}
 		BufferedWriter bw = new BufferedWriter(w);
 		try {
@@ -709,7 +709,7 @@
 		try {
 			fs.putSingle("privateDarknetComment", Base64.encode(comment.getBytes("UTF-8")));
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error(e);
 		}
 		if(localFileNumber == -1) {
 			localFileNumber = writeNewExtraPeerDataFile(fs, Node.EXTRA_PEER_DATA_TYPE_PEER_NOTE);
@@ -810,7 +810,7 @@
 				try {
 					s = new String(Base64.decode(s), "UTF-8");
 				} catch (UnsupportedEncodingException e) {
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+					throw new Error(e);
 				} catch (IllegalBase64Exception e) {
 					// Maybe it wasn't encoded? FIXME remove
 				}
@@ -826,7 +826,7 @@
 			try {
 				fs.putSingle("comment", Base64.encode(comment.getBytes("UTF-8")));
 			} catch (UnsupportedEncodingException e) {
-				throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+				throw new Error(e);
 			}
 			fs.put("size", size);
 		}
@@ -1262,7 +1262,7 @@
 			this.setPeerNodeStatus(System.currentTimeMillis());
 			return getPeerNodeStatus();
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error("Impossible: "+e, e);
 		}
 	}
 
@@ -1296,7 +1296,7 @@
 			this.setPeerNodeStatus(System.currentTimeMillis());
 			return getPeerNodeStatus();
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error("Impossible: "+e, e);
 		}
 	}
 
@@ -1330,7 +1330,7 @@
 			this.setPeerNodeStatus(System.currentTimeMillis());
 			return getPeerNodeStatus();
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error("Impossible: "+e, e);
 		}
 	}
 
@@ -1372,7 +1372,7 @@
 			}
 			return status;
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error("Impossible: "+e, e);
 		}
 	}
 

Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -82,12 +82,8 @@
 	private static final byte[] JFK_PREFIX_INITIATOR, JFK_PREFIX_RESPONDER;
 	static {
 		byte[] I = null,R = null;
-		try {
-			I = "I".getBytes("UTF-8");
-			R = "R".getBytes("UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
-		}
+		try { I = "I".getBytes("UTF-8"); } catch (UnsupportedEncodingException e) {}
+		try { R = "R".getBytes("UTF-8"); } catch (UnsupportedEncodingException e) {}
 		
 		JFK_PREFIX_INITIATOR = I;
 		JFK_PREFIX_RESPONDER = R;
@@ -2792,11 +2788,7 @@
 	private byte[] computeJFKSharedKey(BigInteger exponential, byte[] nI, byte[] nR, String what) {
 		assert("0".equals(what) || "1".equals(what) || "2".equals(what));
 		byte[] number = null;
-		try {
-			number = what.getBytes("UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
-		}
+		try { number = what.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) {}
 		
 		byte[] toHash = new byte[NONCE_SIZE * 2 + number.length];
 		int offset = 0;

Modified: trunk/freenet/src/freenet/node/NodeARKInserter.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeARKInserter.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/NodeARKInserter.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -143,7 +143,7 @@
 		try {
 			buf = s.getBytes("UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error("UTF-8 not supported");
 		}
 		
 		Bucket b = new SimpleReadOnlyArrayBucket(buf);

Modified: trunk/freenet/src/freenet/node/NodeCrypto.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeCrypto.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/NodeCrypto.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -358,10 +358,10 @@
 			return _signature;
 		} catch(UnsupportedEncodingException e){
 			//duh ?
-			Logger.error(this, "Error while signing the node identity!" + e, e);
+			Logger.error(this, "Error while signing the node identity!"+e);
 			System.err.println("Error while signing the node identity!"+e);
 			e.printStackTrace();
-			throw new NodeInitException(NodeInitException.EXIT_CRAPPY_JVM, "Impossible: JVM doesn't support UTF-8");
+			throw new NodeInitException(NodeInitException.EXIT_CRAPPY_JVM, "UTF-8 not supported!");
 		}
 	}
 

Modified: trunk/freenet/src/freenet/node/PeerManager.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerManager.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/PeerManager.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -191,7 +191,7 @@
 		try {
 			ris = new InputStreamReader(fis, "UTF-8");
 		} catch (UnsupportedEncodingException e4) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e4, e4);
+			throw new Error("UTF-8 not supported!: "+e4, e4);
 		}
         BufferedReader br = new BufferedReader(ris);
         try { // FIXME: no better way?
@@ -1040,7 +1040,7 @@
 				w = new OutputStreamWriter(fos, "UTF-8");
 			} catch (UnsupportedEncodingException e2) {
 				Closer.close(w);
-				throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e2, e2);
+				throw new Error("UTF-8 unsupported!: "+e2, e2);
 			}
             BufferedWriter bw = new BufferedWriter(w);
             try {

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/PeerNode.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -263,7 +263,7 @@
 		try {
 			TEST_AS_BYTES = "test".getBytes("UTF-8");
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error(e);
 		}
 	}
 	
@@ -445,7 +445,11 @@
 					Logger.error(this, "Invalid reference: " + e, e);
 					throw new ReferenceSignatureVerificationException("The node reference you added is invalid: It does not have a valid signature.");
 				} catch(UnsupportedEncodingException e) {
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+					//   duh ?
+					Logger.error(this, "Error while signing the node identity!" + e);
+					System.err.println("Error while signing the node identity!" + e);
+					e.printStackTrace();
+					node.exit(NodeInitException.EXIT_CRAPPY_JVM);
 				}
 			} else {
 				// Local is always good (assumed)
@@ -2224,7 +2228,7 @@
 		try {
 			isr = new InputStreamReader(bais, "UTF-8");
 		} catch(UnsupportedEncodingException e1) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e1, e1);
+			throw new Error(e1);
 		}
 		BufferedReader br = new BufferedReader(isr);
 		try {
@@ -3196,7 +3200,8 @@
 		try {
 			ref = new String(data, "UTF-8");
 		} catch(UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			// Yeah, right.
+			throw new Error(e);
 		}
 
 		SimpleFieldSet fs;
@@ -3774,7 +3779,7 @@
 				}
 			}
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error("Impossible: "+e, e);
 		}
 	}
 

Modified: trunk/freenet/src/freenet/node/SSKInsertHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/SSKInsertHandler.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/SSKInsertHandler.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -239,7 +239,7 @@
 					block = new SSKBlock(data, headers, key, true);
 				} catch (SSKVerifyException e1) {
 					// Is verified elsewhere...
-					throw new RuntimeException("Impossible: " + e1, e1);
+					throw new Error("Impossible: "+e1);
 				}
 				try {
 					RequestHandler.sendSSK(headers, data, false, pubKey, source, uid, this);

Modified: trunk/freenet/src/freenet/node/fcp/ClientPut.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPut.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/fcp/ClientPut.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -231,7 +231,6 @@
 				try {
 					md.update(salt.getBytes("UTF-8"));
 				} catch (UnsupportedEncodingException e) {
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
 				}
 				try {
 					InputStream is = data.getInputStream();

Modified: trunk/freenet/src/freenet/node/fcp/PeerNote.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PeerNote.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/node/fcp/PeerNote.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -31,7 +31,7 @@
 		try {
 			fs.putSingle("NoteText", Base64.encode(noteText.getBytes("UTF-8"), true));
 		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+			throw new Error(e);
 		}
 		if(identifier != null)
 			fs.putSingle("Identifier", identifier);

Modified: trunk/freenet/src/freenet/support/SimpleFieldSet.java
===================================================================
--- trunk/freenet/src/freenet/support/SimpleFieldSet.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/support/SimpleFieldSet.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -684,7 +684,7 @@
 			} catch (UnsupportedEncodingException e) {
 				Logger.error(SimpleFieldSet.class, "Impossible: "+e, e);
 				is.close();
-				throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+				return null;
 			}
 			br = new BufferedReader(isr);
 			SimpleFieldSet fs = new SimpleFieldSet(br, allowMultiple, shortLived);

Modified: trunk/freenet/src/freenet/support/URIPreEncoder.java
===================================================================
--- trunk/freenet/src/freenet/support/URIPreEncoder.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/support/URIPreEncoder.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -1,6 +1,5 @@
 package freenet.support;
 
-import java.io.BufferedReader;
 import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -39,7 +38,7 @@
 						output.append(Integer.toHexString(x));
 					}
 				} catch (UnsupportedEncodingException e) {
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+					throw new Error(e);
 				}
 			}
 		}

Modified: trunk/freenet/src/freenet/support/URLDecoder.java
===================================================================
--- trunk/freenet/src/freenet/support/URLDecoder.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/support/URLDecoder.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -3,7 +3,6 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.support;
 
-import java.io.BufferedReader;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
@@ -71,7 +70,7 @@
 							decodedBytes.write(buf, 0, buf.length);
 							continue;
 						} catch (UnsupportedEncodingException e) {
-							throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+							throw new Error(e);
 						}
 					}
 					
@@ -82,7 +81,7 @@
 					byte[] encoded = (""+c).getBytes("UTF-8");
 					decodedBytes.write(encoded, 0, encoded.length);
 				} catch (UnsupportedEncodingException e) {
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+					throw new Error(e);
 				}
 			}
 		}

Modified: trunk/freenet/src/freenet/support/URLEncoder.java
===================================================================
--- trunk/freenet/src/freenet/support/URLEncoder.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/support/URLEncoder.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -3,7 +3,6 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.support;
 
-import java.io.BufferedReader;
 import java.io.UnsupportedEncodingException;
 
 /**
@@ -44,7 +43,7 @@
 						enc.append(Integer.toHexString(x));
 					}
 				} catch (UnsupportedEncodingException e) {
-					throw new RuntimeException("Impossible: JVM doesn't support UTF-8: " + e, e);
+					throw new Error(e);
 				}
 			}
 		}

Modified: trunk/freenet/src/freenet/support/compress/GzipCompressor.java
===================================================================
--- trunk/freenet/src/freenet/support/compress/GzipCompressor.java	2008-05-04 10:13:59 UTC (rev 19726)
+++ trunk/freenet/src/freenet/support/compress/GzipCompressor.java	2008-05-04 10:32:33 UTC (rev 19727)
@@ -102,8 +102,7 @@
 		try {
 			bytes = (int)decompress(bais, baos, output.length, -1);
 		} catch (IOException e) {
-			// Impossible
-			throw new RuntimeException("Got IOException: " + e.getMessage(), e);
+			throw new Error("Got IOException: "+e.getMessage());
 		}
 		byte[] buf = baos.toByteArray();
 		System.arraycopy(buf, 0, output, 0, bytes);




More information about the cvs mailing list