harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r409561 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util: ListResourceBundle.java PropertyResourceBundle.java ResourceBundle.java
Date Fri, 26 May 2006 05:53:31 GMT
Author: mloenko
Date: Thu May 25 22:53:31 2006
New Revision: 409561

URL: http://svn.apache.org/viewvc?rev=409561&view=rev
Log:
fixes for HARMONY-512
[classlib][luni] Generification of xxxResourceBundle classes

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListResourceBundle.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/PropertyResourceBundle.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListResourceBundle.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListResourceBundle.java?rev=409561&r1=409560&r2=409561&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListResourceBundle.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListResourceBundle.java
Thu May 25 22:53:31 2006
@@ -22,9 +22,10 @@
  * the list of resources.
  * 
  * @see ResourceBundle
+ * @since 1.1
  */
 public abstract class ListResourceBundle extends ResourceBundle {
-	
+	//TODO Generify when Hashtable is generified
 	Hashtable table;
 
 	/**
@@ -41,24 +42,24 @@
 	 * 
 	 * @return a Object array containing the resources
 	 */
-	abstract protected Object[][] getContents();
+	protected abstract Object[][] getContents();
 
 	/**
 	 * Answers the names of the resources contained in this ListResourceBundle.
 	 * 
 	 * @return an Enumeration of the resource names
 	 */
-	public Enumeration getKeys() {
+	public Enumeration<String> getKeys() {
 		if (table == null)
 			initializeTable();
 		if (parent == null)
 			return table.keys();
-		return new Enumeration() {
-			Enumeration local = table.keys();
+		return new Enumeration<String>() {
+			Enumeration<String> local = table.keys();
 
-			Enumeration pEnum = parent.getKeys();
+			Enumeration<String> pEnum = parent.getKeys();
 
-			Object nextElement = null;
+			String nextElement = null;
 
 			private boolean findNext() {
 				if (nextElement != null)
@@ -79,11 +80,11 @@
 				return findNext();
 			}
 
-			public Object nextElement() {
+			public String nextElement() {
 				if (local.hasMoreElements())
 					return local.nextElement();
 				if (findNext()) {
-					Object result = nextElement;
+					String result = nextElement;
 					nextElement = null;
 					return result;
 				}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/PropertyResourceBundle.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/PropertyResourceBundle.java?rev=409561&r1=409560&r2=409561&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/PropertyResourceBundle.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/PropertyResourceBundle.java
Thu May 25 22:53:31 2006
@@ -26,9 +26,10 @@
  * 
  * @see ResourceBundle
  * @see Properties
+ * @since 1.1
  */
 public class PropertyResourceBundle extends ResourceBundle {
-	
+	//TODO Generify when Properties is generified
 	Properties resources;
 
 	/**
@@ -50,15 +51,15 @@
 	 * 
 	 * @return an Enumeration of the resource names
 	 */
-	public Enumeration getKeys() {
+	public Enumeration<String> getKeys() {
 		if (parent == null)
 			return resources.keys();
-		return new Enumeration() {
-			Enumeration local = resources.keys();
+		return new Enumeration<String>() {
+			Enumeration<String> local = resources.keys();
 
-			Enumeration pEnum = parent.getKeys();
+			Enumeration<String> pEnum = parent.getKeys();
 
-			Object nextElement = null;
+			String nextElement;
 
 			private boolean findNext() {
 				if (nextElement != null)
@@ -79,11 +80,11 @@
 				return findNext();
 			}
 
-			public Object nextElement() {
+			public String nextElement() {
 				if (local.hasMoreElements())
 					return local.nextElement();
 				if (findNext()) {
-					Object result = nextElement;
+					String result = nextElement;
 					nextElement = null;
 					return result;
 				}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java?rev=409561&r1=409560&r2=409561&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ResourceBundle.java
Thu May 25 22:53:31 2006
@@ -32,8 +32,9 @@
  * 
  * @see Properties
  * @see PropertyResourceBundle
+ * @since 1.1
  */
-abstract public class ResourceBundle {
+public abstract class ResourceBundle {
 	
 	/**
 	 * The parent of this ResourceBundle.
@@ -43,7 +44,7 @@
 	private Locale locale;
 
 	static class MissingBundle extends ResourceBundle {
-		public Enumeration getKeys() {
+		public Enumeration<String> getKeys() {
 			return null;
 		}
 
@@ -52,11 +53,11 @@
 		}
 	}
 
-	private static ResourceBundle MISSING = new MissingBundle();
+	private static final ResourceBundle MISSING = new MissingBundle();
 
-	private static ResourceBundle MISSINGBASE = new MissingBundle();
+	private static final ResourceBundle MISSINGBASE = new MissingBundle();
 
-	private static WeakHashMap cache = new WeakHashMap();
+	private static final WeakHashMap<Object,Hashtable<String,ResourceBundle>> cache
= new WeakHashMap<Object,Hashtable<String,ResourceBundle>>();
 
 	/**
 	 * Constructs a new instance of this class.
@@ -158,7 +159,7 @@
 	 * 
 	 * @return an Enumeration of the resource names
 	 */
-	public abstract Enumeration getKeys();
+	public abstract Enumeration<String> getKeys();
 
 	/**
 	 * Gets the Locale of this ResourceBundle.
@@ -232,7 +233,7 @@
 				cache.put(cacheKey, loaderCache);
 			}
 		}
-		ResourceBundle result = (ResourceBundle) loaderCache.get(bundleName);
+		ResourceBundle result = loaderCache.get(bundleName);
 		if (result != null) {
 			if (result == MISSINGBASE)
 				return null;



Mime
View raw message