harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r410542 - in /incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset: Charset.java spi/CharsetProvider.java
Date Wed, 31 May 2006 14:33:13 GMT
Author: tellison
Date: Wed May 31 07:33:13 2006
New Revision: 410542

URL: http://svn.apache.org/viewvc?rev=410542&view=rev
Log:
Generics uplift for j.n.c.Charset and j.n.c.s.CharsetProvider


Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java?rev=410542&r1=410541&r2=410542&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/Charset.java
Wed May 31 07:33:13 2006
@@ -118,16 +118,19 @@
 	private final String canonicalName;
 
 	// the aliases set
-	private final HashSet aliasesSet;
+	private final HashSet<String> aliasesSet;
 
 	// cached Charset table
-	private static HashMap cachedCharsetTable = new HashMap();
+	private static HashMap<String, Charset> cachedCharsetTable =
+        new HashMap<String, Charset>();
 	
 	// cached CharsetDecoder table
-	private static HashMap cachedCharsetDecoderTable = new HashMap();
+	private static HashMap<String, CharsetDecoder> cachedCharsetDecoderTable =
+        new HashMap<String, CharsetDecoder>();
 	
 	// cached CharsetEncoder table
-	private static HashMap cachedCharsetEncoderTable = new HashMap();
+	private static HashMap<String, CharsetEncoder> cachedCharsetEncoderTable =
+        new HashMap<String, CharsetEncoder>();
 	
 	/*
 	 * -------------------------------------------------------------------
@@ -177,7 +180,7 @@
 		checkCharsetName(canonicalName);
 		this.canonicalName = canonicalName;
 		// check each aliase and put into a set
-		this.aliasesSet = new HashSet();
+		this.aliasesSet = new HashSet<String>();
 		if (null != aliases) {
 			for (int i = 0; i < aliases.length; i++) {
 				checkCharsetName(aliases[i]);
@@ -339,7 +342,7 @@
 	 * @return an unmodifiable map of all available charsets supported by the
 	 *         runtime
 	 */
-	public static SortedMap availableCharsets() {
+	public static SortedMap<String, Charset> availableCharsets() {
 		// Initialize the built-in charsets map cache if necessary
 		if (null == _builtInCharsets) {
 			synchronized (Charset.class) {
@@ -790,7 +793,7 @@
 	/**
 	 * A comparator that ignores case.
 	 */
-	static class IgnoreCaseComparator implements Comparator {
+	static class IgnoreCaseComparator implements Comparator<String> {
 
 		// the singleton
 		private static Comparator c = new IgnoreCaseComparator();
@@ -812,9 +815,7 @@
 		/*
 		 * Compares two strings ignoring case.
 		 */
-		public int compare(Object obj1, Object obj2) {
-			String s1 = (String) obj1;
-			String s2 = (String) obj2;
+		public int compare(String s1, String s2) {
 			return s1.compareToIgnoreCase(s2);
 		}
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java?rev=410542&r1=410541&r2=410542&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio_char/src/main/java/java/nio/charset/spi/CharsetProvider.java
Wed May 31 07:33:13 2006
@@ -46,7 +46,7 @@
 	 * 
 	 * @return the iterator.
 	 */
-	public abstract Iterator charsets();
+	public abstract Iterator<Charset> charsets();
 
 	/**
 	 * Answers the named charset.



Mime
View raw message