aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-10-02 12:14:44 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-10-02 12:14:44 +0000
commitcb9b7827d92c0956767eee90206909a15457a7f8 (patch)
tree107ff6d044b227f291d0c4326516be6323dfce4b /libjava
parent7485f79f141237a216201f05aef6e161cb4ff08a (diff)
downloadgcc-cb9b7827d92c0956767eee90206909a15457a7f8.zip
gcc-cb9b7827d92c0956767eee90206909a15457a7f8.tar.gz
gcc-cb9b7827d92c0956767eee90206909a15457a7f8.tar.bz2
2003-10-02 Michael Koch <konqueror@gmx.de>
* java/net/URL.java (DEFAULT_SEARCH_PATH): New static variable. (ph_cache): Made it a HashMap. (getURLStreamHandler): Rename propVal to ph_search_path and use DEFAULT_SEARCH_PATH. From-SVN: r72023
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/java/net/URL.java20
2 files changed, 21 insertions, 7 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index c11753b..6d65490 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,13 @@
2003-10-02 Michael Koch <konqueror@gmx.de>
+ * java/net/URL.java
+ (DEFAULT_SEARCH_PATH): New static variable.
+ (ph_cache): Made it a HashMap.
+ (getURLStreamHandler): Rename propVal to ph_search_path and use
+ DEFAULT_SEARCH_PATH.
+
+2003-10-02 Michael Koch <konqueror@gmx.de>
+
* javax/swing/table/AbstractTableModel.java
(findColumnName): Prevent from NullPointerException if argument
columnName is null.
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 6585c52..62c9e6b 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -43,10 +43,9 @@ import java.io.IOException;
import java.io.Serializable;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.util.Hashtable;
+import java.util.HashMap;
import java.util.StringTokenizer;
-
/*
* Written using on-line Java Platform 1.2 API Specification, as well
* as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
@@ -119,6 +118,9 @@ import java.util.StringTokenizer;
*/
public final class URL implements Serializable
{
+ private static final String DEFAULT_SEARCH_PATH =
+ "gnu.java.net.protocol|sun.net.www.protocol";
+
/**
* The name of the protocol for this URL.
* The protocol is always stored in lower case.
@@ -174,7 +176,7 @@ public final class URL implements Serializable
* This a table where we cache protocol handlers to avoid the overhead
* of looking them up each time.
*/
- private static Hashtable ph_cache = new Hashtable();
+ private static HashMap ph_cache = new HashMap();
/**
* Whether or not to cache protocol handlers.
@@ -798,12 +800,16 @@ public final class URL implements Serializable
// to it, along with the JDK specified default as a last resort.
// Except in very unusual environments the JDK specified one shouldn't
// ever be needed (or available).
- String propVal = System.getProperty("java.protocol.handler.pkgs");
- propVal = (propVal == null) ? "" : (propVal + "|");
- propVal = propVal + "gnu.gcj.protocol|sun.net.www.protocol";
+ String ph_search_path = System.getProperty ("java.protocol.handler.pkgs");
+
+ // Tack our default package on at the ends.
+ if (ph_search_path != null)
+ ph_search_path += "|" + DEFAULT_SEARCH_PATH;
+ else
+ ph_search_path = DEFAULT_SEARCH_PATH;
// Finally loop through our search path looking for a match.
- StringTokenizer pkgPrefix = new StringTokenizer (propVal, "|");
+ StringTokenizer pkgPrefix = new StringTokenizer (ph_search_path, "|");
do
{