diff options
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/URI.java')
| -rw-r--r-- | projects/net.wotonomy.web/src/main/java/net/wotonomy/web/URI.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/URI.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/URI.java index ba608a4..99716bf 100644 --- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/URI.java +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/URI.java @@ -70,16 +70,13 @@ import java.io.IOException; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.net.URL; -import java.security.AccessController; import java.util.BitSet; import java.util.Hashtable; import java.util.Locale; -import sun.security.action.GetPropertyAction; - /** * The interface for the URI(Uniform Resource Identifiers) version of RFC 2396. - * This class has the purpose of supportting of parsing a URI reference to + * This class has the purpose of supporting of parsing a URI reference to * extend any specific protocols, the character encoding of the protocol to be * transported and the charset of the document. * <p> @@ -166,7 +163,7 @@ import sun.security.action.GetPropertyAction; * @author <a href="mailto:jericho@apache.org">Sung-Gu</a> * @version $Revision: 905 $ $Date: 2002/03/14 15:14:01 */ -class URI implements Cloneable, Comparable, Serializable { +class URI implements Cloneable, Comparable<URI>, Serializable { // ----------------------------------------------------------- Constructors @@ -571,7 +568,7 @@ class URI implements Cloneable, Comparable, Serializable { // in order to support backward compatiblity _documentCharset = LocaleToCharsetMap.getCharset(locale); } else { - _documentCharset = (String) AccessController.doPrivileged(new GetPropertyAction("file.encoding")); + _documentCharset = "UTF-8"; //(String) AccessController.doPrivileged(new GetPropertyAction("file.encoding")); } } @@ -3459,9 +3456,7 @@ class URI implements Cloneable, Comparable, Serializable { * @exception ClassCastException not URI argument * @throws NullPointerException null object */ - public int compareTo(Object obj) { - - URI another = (URI) obj; + public int compareTo(URI another) { if (!equals(_authority, another.getRawAuthority())) return -1; return toString().compareTo(another.toString()); @@ -3582,9 +3577,9 @@ class URI implements Cloneable, Comparable, Serializable { */ public static class LocaleToCharsetMap { - private static Hashtable map; + private static Hashtable<String, String> map; static { - map = new Hashtable(); + map = new Hashtable<>(); map.put("ar", "ISO-8859-6"); map.put("be", "ISO-8859-5"); map.put("bg", "ISO-8859-5"); |
