[kaffe] Two library fixes.

Mark J Roberts mjr@znex.org
Wed Feb 12 11:04:01 2003


(1) java 1.4 URLDecoder.decode() throws IllegalArgumentException.
(2) java 1.4 Calendar.getTimeInMillis() is public.

Index: libraries/javalib/java/net/URLDecoder.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/net/URLDecoder.java,v
retrieving revision 1.3
diff -u -r1.3 URLDecoder.java
--- libraries/javalib/java/net/URLDecoder.java	9 Dec 1999 19:50:31 -0000	1.3
+++ libraries/javalib/java/net/URLDecoder.java	12 Feb 2003 19:01:06 -0000
@@ -20,7 +20,7 @@
 	public URLDecoder() {
 	}
 
-	public static String decode(String s) throws Exception {
+	public static String decode(String s) {
 		StringBuffer buf = new StringBuffer();
 
 		for (int pos = 0; pos < s.length(); pos++) {
@@ -32,7 +32,7 @@
 					buf.append((char)Integer.parseInt(
 					    s.substring(pos + 1, pos + 3), 16));
 				} else {
-					throw new Exception("invalid input");
+					throw new IllegalArgumentException("invalid input");
 				}
 				pos += 2;
 			} else {
Index: libraries/javalib/java/util/Calendar.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/util/Calendar.java,v
retrieving revision 1.12
diff -u -r1.12 Calendar.java
--- libraries/javalib/java/util/Calendar.java	4 Sep 2002 11:10:46 -0000	1.12
+++ libraries/javalib/java/util/Calendar.java	12 Feb 2003 19:01:07 -0000
@@ -259,7 +259,7 @@
 	return (new Date(getTimeInMillis()));
 }
 
-protected long getTimeInMillis()
+public long getTimeInMillis()
 {
 	if (!isTimeSet) {
 		computeTime();