harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r393797 [1/3] - in /incubator/harmony/enhanced/classlib/trunk/modules: auth/src/main/java/common/javax/security/sasl/ luni-kernel/src/main/java/java/lang/ luni/src/main/java/java/lang/ luni/src/main/java/java/util/ security-kernel/src/main/...
Date Thu, 13 Apr 2006 13:09:16 GMT
Author: mloenko
Date: Thu Apr 13 06:08:58 2006
New Revision: 393797

URL: http://svn.apache.org/viewcvs?rev=393797&view=rev
Log:
switching security related classes to 1.5 signatures
updating affected luni classes and developing a stub for java.lang.Enum

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Class.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ArrayList.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Dictionary.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Enumeration.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Hashtable.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListIterator.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Map.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MapEntry.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Properties.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Set.java
    incubator/harmony/enhanced/classlib/trunk/modules/security-kernel/src/main/java/java/security/AccessController.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParametersSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactorySpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedAction.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedExceptionAction.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/SecureClassLoader.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Security.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/acl/Acl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/acl/AclEntry.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/acl/Group.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertPath.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertStore.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertStoreSpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CertificateFactorySpi.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/CollectionCertStoreParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXBuilderParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXCertPathChecker.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PKIXParameters.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/PolicyNode.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRL.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CRLSelector.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509CertSelector.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509Certificate.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/cert/X509Extension.java
    incubator/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/Sasl.java Thu Apr 13 06:08:58 2006
@@ -179,7 +179,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public static Enumeration getSaslClientFactories() {
+    public static Enumeration<SaslClientFactory> getSaslClientFactories() {
         //        Vector res = findFactories(CLIENTFACTORYSRV);
         Collection res = findFactories(CLIENTFACTORYSRV);
         return Collections.enumeration(res);
@@ -190,7 +190,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public static Enumeration getSaslServerFactories() {
+    public static Enumeration<SaslServerFactory> getSaslServerFactories() {
         //        Vector res = findFactories(SERVERFACTORYSRV);
         Collection res = findFactories(SERVERFACTORYSRV);
         return Collections.enumeration(res);
@@ -201,7 +201,7 @@
      *  
      */
     public static SaslServer createSaslServer(String mechanism,
-            String protocol, String serverName, Map prop, CallbackHandler cbh)
+            String protocol, String serverName, Map<String,?> prop, CallbackHandler cbh)
             throws SaslException {
         if (mechanism == null) {
             throw new NullPointerException("mechanism is null");
@@ -244,7 +244,7 @@
      */
     public static SaslClient createSaslClient(String[] mechanisms,
             String authanticationID, String protocol, String serverName,
-            Map prop, CallbackHandler cbh) throws SaslException {
+            Map<String,?> prop, CallbackHandler cbh) throws SaslException {
         if (mechanisms == null) {
             throw new NullPointerException("mechanisms is null");
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslClientFactory.java Thu Apr 13 06:08:58 2006
@@ -31,18 +31,14 @@
 public interface SaslClientFactory {
     /**
      * @com.intel.drl.spec_ref
-     * 
-     * FIXME: Map <String,?>props for 1.5
      */
     public SaslClient createSaslClient(String[] mechanisms,
             String authorizationId, String protocol, String serverName,
-            Map props, CallbackHandler cbh) throws SaslException;
+            Map<String,?> props, CallbackHandler cbh) throws SaslException;
 
     /**
      * @com.intel.drl.spec_ref
-     * 
-     * FIXME: Map <String,?>props for 1.5
      */
-    public String[] getMechanismNames(Map props);
+    public String[] getMechanismNames(Map<String,?> props);
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/javax/security/sasl/SaslServerFactory.java Thu Apr 13 06:08:58 2006
@@ -31,18 +31,14 @@
 public interface SaslServerFactory {
     /**
      * @com.intel.drl.spec_ref
-     * 
-     * FIXME: Map <String,?>props for 1.5
      */
     public SaslServer createSaslServer(String mechanisms, String protocol,
-            String serverName, Map props, CallbackHandler cbh)
+            String serverName, Map<String,?> props, CallbackHandler cbh)
             throws SaslException;
 
     /**
      * @com.intel.drl.spec_ref
-     * 
-     * FIXME: Map <String,?>props for 1.5
      */
-    public String[] getMechanismNames(Map props);
+    public String[] getMechanismNames(Map<String,?> props);
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Class.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Class.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Class.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Class.java Thu Apr 13 06:08:58 2006
@@ -65,7 +65,7 @@
  * </dl>
  * 
  */
-public final class Class implements java.io.Serializable {
+public final class Class<T> implements java.io.Serializable {
 	private static final long serialVersionUID = 3206093459760846163L;
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Comparable.java Thu Apr 13 06:08:58 2006
@@ -28,7 +28,7 @@
  * true.
  * 
  */
-public interface Comparable {
+public interface Comparable<T> {
 	
 	/**
 	 * Answers an integer indicating the relative positions of the receiver and
@@ -45,5 +45,5 @@
 	 *             if the argument can not be converted into something
 	 *             comparable with the receiver.
 	 */
-	int compareTo(Object another);
+	int compareTo(T another);
 }

Added: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java?rev=393797&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java Thu Apr 13 06:08:58 2006
@@ -0,0 +1,80 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+import java.io.Serializable;
+
+/**
+ * Stub for Enum 
+ */
+public class Enum <E extends Enum<E>> implements Serializable, Comparable<E> {
+
+    private String name;
+
+
+    private int ordinal;
+
+
+    protected Enum(String name, int ordinal) {
+        this.name = name;
+        this.ordinal = ordinal;
+    }
+
+
+    public final String name() {
+        return name;
+    }
+
+
+    public final int ordinal() {
+        return ordinal;
+    }
+
+
+    public String toString() {
+        return "Enum:" + name;
+    }
+
+
+    public final boolean equals(Object other) {
+        throw new RuntimeException("not yet implemented");
+    }
+
+
+    public final int hashCode() {
+        return ordinal + (name == null ? 0 : name.hashCode());
+    }
+
+
+    protected final Object clone() throws CloneNotSupportedException {
+        return new Enum<E> (name, ordinal);
+    }
+
+
+    public final int compareTo(E o) {
+        return ordinal - o.ordinal;
+    }
+
+
+    public final Class<E> getDeclaringClass() {
+        throw new RuntimeException("not yet implemented");
+    }
+
+
+    public static <T extends Enum<T>> T valueOf(Class<T> enumType, String name) {
+        throw new RuntimeException("not yet implemented");
+    }
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractCollection.java Thu Apr 13 06:08:58 2006
@@ -24,7 +24,7 @@
  * abstract methods iterator() and size().
  */
 
-public abstract class AbstractCollection implements Collection {
+public abstract class AbstractCollection<E> implements Collection<E> {
 
 	/**
 	 * Constructs a new instance of this AbstractCollection.
@@ -38,7 +38,7 @@
 	 * 
 	 * @see java.util.Collection#add(java.lang.Object)
 	 */
-	public boolean add(Object object) {
+	public boolean add(E object) {
 		throw new UnsupportedOperationException();
 	}
 
@@ -57,9 +57,9 @@
 	 * @exception IllegalArgumentException
 	 *                when an object cannot be added to this Collection
 	 */
-	public boolean addAll(Collection collection) {
+	public boolean addAll(Collection<? extends E> collection) {
 		boolean result = false;
-		Iterator it = collection.iterator();
+		Iterator<? extends E> it = collection.iterator();
 		while (it.hasNext())
 			if (add(it.next()))
 				result = true;
@@ -109,7 +109,7 @@
 	 * @return true if all objects in the specified Collection are elements of
 	 *         this Collection, false otherwise
 	 */
-	public boolean containsAll(Collection collection) {
+	public boolean containsAll(Collection<?> collection) {
 		Iterator it = collection.iterator();
 		while (it.hasNext())
 			if (!contains(it.next()))
@@ -178,7 +178,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Collection is not supported
 	 */
-	public boolean removeAll(Collection collection) {
+	public boolean removeAll(Collection<?> collection) {
 		boolean result = false;
 		Iterator it = iterator();
 		while (it.hasNext()) {
@@ -201,7 +201,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Collection is not supported
 	 */
-	public boolean retainAll(Collection collection) {
+	public boolean retainAll(Collection<?> collection) {
 		boolean result = false;
 		Iterator it = iterator();
 		while (it.hasNext()) {
@@ -249,11 +249,11 @@
 	 *                when the type of an element in this Collection cannot be
 	 *                stored in the type of the specified array
 	 */
-	public Object[] toArray(Object[] contents) {
+	public <T> T[] toArray(T[] contents) {
 		int size = size(), index = 0;
-		Iterator it = iterator();
+		Iterator<T> it = iterator();
 		if (size > contents.length)
-			contents = (Object[]) Array.newInstance(contents.getClass()
+			contents = (T[]) Array.newInstance(contents.getClass()
 					.getComponentType(), size);
 		while (index < size)
 			contents[index++] = it.next();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractList.java Thu Apr 13 06:08:58 2006
@@ -22,11 +22,11 @@
  * not support adding or replacing. A subclass must implement the abstract
  * methods get() and size().
  */
-public abstract class AbstractList extends AbstractCollection implements List {
+public abstract class AbstractList<E> extends AbstractCollection<E> implements List<E> {
 
 	protected transient int modCount = 0;
 
-	private class SimpleListIterator implements Iterator {
+	private class SimpleListIterator implements Iterator<E> {
 		int pos = -1, expectedModCount;
 
 		int lastPosition = -1;
@@ -39,10 +39,10 @@
 			return pos + 1 < size();
 		}
 
-		public Object next() {
+		public E next() {
 			if (expectedModCount == modCount) {
 				try {
-					Object result = get(pos + 1);
+					E result = get(pos + 1);
 					lastPosition = ++pos;
 					return result;
 				} catch (IndexOutOfBoundsException e) {
@@ -70,7 +70,7 @@
 	}
 
 	private final class FullListIterator extends SimpleListIterator implements
-			ListIterator {
+			ListIterator<E> {
 		FullListIterator(int start) {
 			if (0 <= start && start <= size())
 				pos = start - 1;
@@ -78,7 +78,7 @@
 				throw new IndexOutOfBoundsException();
 		}
 
-		public void add(Object object) {
+		public void add(E object) {
 			if (expectedModCount == modCount) {
 				try {
 					AbstractList.this.add(pos + 1, object);
@@ -101,10 +101,10 @@
 			return pos + 1;
 		}
 
-		public Object previous() {
+		public E previous() {
 			if (expectedModCount == modCount) {
 				try {
-					Object result = get(pos);
+					E result = get(pos);
 					lastPosition = pos;
 					pos--;
 					return result;
@@ -119,7 +119,7 @@
 			return pos;
 		}
 
-		public void set(Object object) {
+		public void set(E object) {
 			if (expectedModCount == modCount) {
 				try {
 					AbstractList.this.set(lastPosition, object);
@@ -353,7 +353,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public void add(int location, Object object) {
+	public void add(int location, E object) {
 		throw new UnsupportedOperationException();
 	}
 
@@ -373,7 +373,7 @@
 	 * @exception IllegalArgumentException
 	 *                when the object cannot be added to this List
 	 */
-	public boolean add(Object object) {
+	public boolean add(E object) {
 		add(size(), object);
 		return true;
 	}
@@ -399,8 +399,8 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public boolean addAll(int location, Collection collection) {
-		Iterator it = collection.iterator();
+	public boolean addAll(int location, Collection<? extends E> collection) {
+		Iterator<E> it = collection.iterator();
 		while (it.hasNext())
 			add(location++, it.next());
 		return !collection.isEmpty();
@@ -463,7 +463,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public abstract Object get(int location);
+	public abstract E get(int location);
 
 	/**
 	 * Answers an integer hash code for the receiver. Objects which are equal
@@ -516,7 +516,7 @@
 	 * 
 	 * @see Iterator
 	 */
-	public Iterator iterator() {
+	public Iterator<E> iterator() {
 		return new SimpleListIterator();
 	}
 
@@ -552,7 +552,7 @@
 	 * 
 	 * @see ListIterator
 	 */
-	public ListIterator listIterator() {
+	public ListIterator<E> listIterator() {
 		return listIterator(0);
 	}
 
@@ -571,7 +571,7 @@
 	 * 
 	 * @see ListIterator
 	 */
-	public ListIterator listIterator(int location) {
+	public ListIterator<E> listIterator(int location) {
 		return new FullListIterator(location);
 	}
 
@@ -588,7 +588,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object remove(int location) {
+	public E remove(int location) {
 		throw new UnsupportedOperationException();
 	}
 
@@ -635,7 +635,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object set(int location, Object object) {
+	public E set(int location, E object) {
 		throw new UnsupportedOperationException();
 	}
 
@@ -644,7 +644,7 @@
 	 * 
 	 * @see java.util.List#subList(int, int)
 	 */
-	public List subList(int start, int end) {
+	public List<E> subList(int start, int end) {
 		if (0 <= start && end <= size()) {
 			if (start <= end) {
 				if (this instanceof RandomAccess)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractSet.java Thu Apr 13 06:08:58 2006
@@ -21,7 +21,7 @@
  * implemenation does not support adding. A subclass must implement the abstract
  * methods iterator() and size().
  */
-public abstract class AbstractSet extends AbstractCollection implements Set {
+public abstract class AbstractSet<E> extends AbstractCollection<E> implements Set<E> {
 	
 	/**
 	 * Constructs a new instance of this AbstractSet.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ArrayList.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ArrayList.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ArrayList.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ArrayList.java Thu Apr 13 06:08:58 2006
@@ -28,7 +28,7 @@
  * operations are supported, adding, removing, and replacing. The elements can
  * be any objects.
  */
-public class ArrayList extends AbstractList implements List, Cloneable,
+public class ArrayList<E> extends AbstractList<E> implements List<E>, Cloneable,
 		Serializable, RandomAccess {
 
 	private static final long serialVersionUID = 8683452581122892189L;
@@ -68,7 +68,7 @@
 	 * @param collection
 	 *            the collection of elements to add
 	 */
-	public ArrayList(Collection collection) {
+	public ArrayList(Collection<? extends E> collection) {
 		int size = collection.size();
 		firstIndex = lastIndex = 0;
 		array = new Object[size + (size / 10)];
@@ -89,7 +89,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public void add(int location, Object object) {
+	public void add(int location, E object) {
 		int size = size();
 		if (0 < location && location < size) {
 			if (firstIndex == 0 && lastIndex == array.length) {
@@ -126,7 +126,7 @@
 	 *            the object to add
 	 * @return true
 	 */
-	public boolean add(Object object) {
+	public boolean add(E object) {
 		if (lastIndex == array.length)
 			growAtEnd(1);
 		array[lastIndex++] = object;
@@ -148,7 +148,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public boolean addAll(int location, Collection collection) {
+	public boolean addAll(int location, Collection<? extends E> collection) {
 		int size = size();
 		int growSize = collection.size();
 		if (0 < location && location < size) {
@@ -202,7 +202,7 @@
 	 *            the Collection of objects
 	 * @return true if this ArrayList is modified, false otherwise
 	 */
-	public boolean addAll(Collection collection) {
+	public boolean addAll(Collection<? extends E> collection) {
 		int growSize = collection.size();
 		if (growSize > 0) {
 			if (lastIndex > array.length - growSize)
@@ -297,9 +297,9 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object get(int location) {
+	public E get(int location) {
 		if (0 <= location && location < size())
-			return array[firstIndex + location];
+			return (E)array[firstIndex + location];
 		throw new IndexOutOfBoundsException();
 	}
 
@@ -442,19 +442,19 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object remove(int location) {
-		Object result;
+	public E remove(int location) {
+		E result;
 		int size = size();
 		if (0 <= location && location < size) {
 			if (location == size - 1) {
-				result = array[--lastIndex];
+				result = (E)array[--lastIndex];
 				array[lastIndex] = null;
 			} else if (location == 0) {
-				result = array[firstIndex];
+				result = (E)array[firstIndex];
 				array[firstIndex++] = null;
 			} else {
 				int elementIndex = firstIndex + location;
-				result = array[elementIndex];
+				result = (E)array[elementIndex];
 				if (location < size / 2) {
 					System.arraycopy(array, firstIndex, array, firstIndex + 1,
 							location);
@@ -521,9 +521,9 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object set(int location, Object object) {
+	public E set(int location, E object) {
 		if (0 <= location && location < size()) {
-			Object result = array[firstIndex + location];
+			E result = (E)array[firstIndex + location];
 			array[firstIndex + location] = object;
 			return result;
 		}
@@ -566,10 +566,10 @@
 	 *                when the type of an element in this ArrayList cannot be
 	 *                stored in the type of the specified array
 	 */
-	public Object[] toArray(Object[] contents) {
+	public <T> T[] toArray(T[] contents) {
 		int size = size();
 		if (size > contents.length)
-			contents = (Object[]) Array.newInstance(contents.getClass()
+			contents = (T[]) Array.newInstance(contents.getClass()
 					.getComponentType(), size);
 		System.arraycopy(array, firstIndex, contents, 0, size);
 		if (size < contents.length)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collection.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Collection.java Thu Apr 13 06:08:58 2006
@@ -19,7 +19,7 @@
 /**
  * Collection is the root of the collection hierarchy.
  */
-public interface Collection {
+public interface Collection<E> {
 
 	/**
 	 * Attempts to add <code>object</code> to the contents of this
@@ -38,7 +38,7 @@
 	 * @exception IllegalArgumentException
 	 *                when the object cannot be added to this Collection
 	 */
-	public boolean add(Object object);
+	public boolean add(E object);
 
 	/**
 	 * Attempts to add all of the objects contained in <code>collection</code>
@@ -56,7 +56,7 @@
 	 * @exception IllegalArgumentException
 	 *                when an object cannot be added to this Collection
 	 */
-	public boolean addAll(Collection collection);
+	public boolean addAll(Collection<? extends E> collection);
 
 	/**
 	 * Removes all elements from this Collection, leaving it empty.
@@ -86,7 +86,7 @@
 	 * @return true if all objects in the specified Collection are elements of
 	 *         this Collection, false otherwise
 	 */
-	public boolean containsAll(Collection collection);
+	public boolean containsAll(Collection<?> collection);
 
 	/**
 	 * Compares the argument to the receiver, and answers true if they represent
@@ -151,7 +151,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Collection is not supported
 	 */
-	public boolean removeAll(Collection collection);
+	public boolean removeAll(Collection<?> collection);
 
 	/**
 	 * Removes all objects from this Collection that are not also found in the
@@ -164,7 +164,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Collection is not supported
 	 */
-	public boolean retainAll(Collection collection);
+	public boolean retainAll(Collection<?> collection);
 
 	/**
 	 * Returns a count of how many objects are contained by this collection.
@@ -195,5 +195,5 @@
 	 *                when the type of an element in this Collection cannot be
 	 *                stored in the type of the specified array
 	 */
-	public Object[] toArray(Object[] array);
+	public <T> T[] toArray(T[] array);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Dictionary.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Dictionary.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Dictionary.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Dictionary.java Thu Apr 13 06:08:58 2006
@@ -22,7 +22,7 @@
  * 
  * @see Hashtable
  */
-public abstract class Dictionary {
+public abstract class Dictionary<K,V> {
 	/**
 	 * Constructs a new instance of this class.
 	 * 
@@ -52,7 +52,7 @@
 	 * 
 	 * @see #put
 	 */
-	abstract public Object get(Object key);
+	abstract public V get(K key);
 
 	/**
 	 * Answers if this Dictionary has no key/value pairs, a size of zero.
@@ -92,7 +92,7 @@
 	 * @see #get
 	 * @see #keys
 	 */
-	abstract public Object put(Object key, Object value);
+	abstract public V put(K key, V value);
 
 	/**
 	 * Remove the key/value pair with the specified <code>key</code> from this
@@ -106,7 +106,7 @@
 	 * @see #get
 	 * @see #put
 	 */
-	abstract public Object remove(Object key);
+	abstract public V remove(K key);
 
 	/**
 	 * Answers the number of key/value pairs in this Dictionary.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Enumeration.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Enumeration.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Enumeration.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Enumeration.java Thu Apr 13 06:08:58 2006
@@ -23,7 +23,7 @@
  * @see Properties
  * @see Vector
  */
-public interface Enumeration {
+public interface Enumeration<E> {
 	/**
 	 * Answers if this Enumeration has more elements.
 	 * 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashSet.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashSet.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashSet.java Thu Apr 13 06:08:58 2006
@@ -25,7 +25,7 @@
  * HashSet is an implementation of Set. All optional operations are supported,
  * adding and removing. The elements can be any objects.
  */
-public class HashSet extends AbstractSet implements Set, Cloneable,
+public class HashSet<E> extends AbstractSet<E> implements Set<E>, Cloneable,
 		Serializable {
 
 	private static final long serialVersionUID = -5024744406713321676L;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Hashtable.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Hashtable.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Hashtable.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Hashtable.java Thu Apr 13 06:08:58 2006
@@ -35,7 +35,7 @@
  * @see java.lang.Object#hashCode
  */
 
-public class Hashtable extends Dictionary implements Map, Cloneable,
+public class Hashtable<K,V> extends Dictionary<K,V> implements Map<K,V>, Cloneable,
 		Serializable {
 
 	private static final long serialVersionUID = 1421746759512286392L;
@@ -61,12 +61,12 @@
 		return new Entry(key, value);
 	}
 
-	private static class Entry extends MapEntry {
+	private static class Entry<K,V> extends MapEntry<K,V> {
 		Entry next;
 		
 		final int hashcode;
 
-		Entry(Object theKey, Object theValue) {
+		Entry(K theKey, V theValue) {
 			super(theKey, theValue);
 			hashcode = theKey.hashCode();
 		}
@@ -78,10 +78,10 @@
 			return entry;
 		}
 
-		public Object setValue(Object object) {
+		public V setValue(V object) {
 			if (object == null)
 				throw new NullPointerException();
-			Object result = value;
+			V result = value;
 			value = object;
 			return result;
 		}
@@ -90,7 +90,7 @@
 			return key.hashCode();
 		}
 
-		public boolean equalsKey(Object aKey, int hash) {
+		public boolean equalsKey(K aKey, int hash) {
 			return hashcode == aKey.hashCode() && key.equals(aKey);
 		}
 
@@ -404,7 +404,7 @@
 	 * @return a Set of the mappings
 	 */
 	public Set entrySet() {
-		return new Collections.SynchronizedSet(new AbstractSet() {
+		return new Collections.SynchronizedSet(new AbstractSet<Map.Entry<K,V>>() {
 			public int size() {
 				return elementCount;
 			}
@@ -413,20 +413,17 @@
 				Hashtable.this.clear();
 			}
 
-			public boolean remove(Object object) {
+			public boolean remove(Map.Entry<K,V> object) {
 				if (contains(object)) {
-					Hashtable.this.remove(((Map.Entry) object).getKey());
+					Hashtable.this.remove(object.getKey());
 					return true;
 				}
 				return false;
 			}
 
-			public boolean contains(Object object) {
-				if (object instanceof Map.Entry) {
-					Entry entry = getEntry(((Map.Entry) object).getKey());
-					return object.equals(entry);
-				}
-				return false;
+			public boolean contains(Map.Entry<K,V> object) {
+				Entry entry = getEntry(object.getKey());
+				return object.equals(entry);
 			}
 
 			public Iterator iterator() {
@@ -479,10 +476,10 @@
 	 * 
 	 * @see #put
 	 */
-	public synchronized Object get(Object key) {
+	public synchronized V get(K key) {
 		int hash = key.hashCode();
 		int index = (hash & 0x7FFFFFFF) % elementData.length;
-		Entry entry = elementData[index];
+		Entry<K,V> entry = elementData[index];
 		while (entry != null) {
 			if (entry.equalsKey(key, hash))
 				return entry.value;
@@ -562,7 +559,7 @@
 	 * @return a Set of the keys
 	 */
 	public Set keySet() {
-		return new Collections.SynchronizedSet(new AbstractSet() {
+		return new Collections.SynchronizedSet(new AbstractSet<K>() {
 			public boolean contains(Object object) {
 				return containsKey(object);
 			}
@@ -583,7 +580,7 @@
 				return false;
 			}
 
-			public Iterator iterator() {
+			public Iterator<MapEntry.Type> iterator() {
 				return new HashIterator(new MapEntry.Type() {
 					public Object get(MapEntry entry) {
 						return entry.key;
@@ -610,11 +607,11 @@
 	 * @see #keys
 	 * @see java.lang.Object#equals
 	 */
-	public synchronized Object put(Object key, Object value) {
+	public synchronized V put(K key, V value) {
 		if (key != null && value != null) {
 			int hash = key.hashCode();
 			int index = (hash & 0x7FFFFFFF) % elementData.length;
-			Entry entry = elementData[index];
+			Entry<K,V> entry = elementData[index];
 			while (entry != null && !entry.equalsKey(key, hash))
 				entry = entry.next;
 			if (entry == null) {
@@ -632,7 +629,7 @@
 				elementData[index] = entry;
 				return null;
 			}
-			Object result = entry.value;
+			V result = entry.value;
 			entry.value = value;
 			return result;
 		} else
@@ -645,10 +642,10 @@
 	 * @param map
 	 *            the Map to copy mappings from
 	 */
-	public synchronized void putAll(Map map) {
-		Iterator it = map.entrySet().iterator();
+	public synchronized void putAll(Map<? extends K,? extends V> map) {
+		Iterator<Map.Entry<K,V>> it = map.entrySet().iterator();
 		while (it.hasNext()) {
-			Map.Entry entry = (Map.Entry) it.next();
+			Map.Entry<K,V> entry = it.next();
 			put(entry.getKey(), entry.getValue());
 		}
 	}
@@ -695,11 +692,11 @@
 	 * @see #get
 	 * @see #put
 	 */
-	public synchronized Object remove(Object key) {
+	public synchronized V remove(Object key) {
 		int hash = key.hashCode();
 		int index = (hash & 0x7FFFFFFF) % elementData.length;
-		Entry last = null;
-		Entry entry = elementData[index];
+		Entry<Object,V> last = null;
+		Entry<Object,V> entry = elementData[index];
 		while (entry != null && !entry.equalsKey(key, hash)) {
 			last = entry;
 			entry = entry.next;
@@ -711,7 +708,7 @@
 			else
 				last.next = entry.next;
 			elementCount--;
-			Object result = entry.value;
+			V result = entry.value;
 			entry.value = null;
 			return result;
 		}
@@ -773,7 +770,7 @@
 	 * 
 	 * @return a Collection of the values
 	 */
-	public Collection values() {
+	public Collection<V> values() {
 		return new Collections.SynchronizedCollection(new AbstractCollection() {
 			public boolean contains(Object object) {
 				return Hashtable.this.contains(object);
@@ -787,7 +784,7 @@
 				Hashtable.this.clear();
 			}
 
-			public Iterator iterator() {
+			public Iterator<MapEntry.Type> iterator() {
 				return new HashIterator(new MapEntry.Type() {
 					public Object get(MapEntry entry) {
 						return entry.value;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java Thu Apr 13 06:08:58 2006
@@ -19,7 +19,7 @@
 /**
  * An Iterator is used to sequence over a collection of objects.
  */
-public interface Iterator {
+public interface Iterator<E> {
 	/**
 	 * Answers if there are more elements to iterate.
 	 * 
@@ -39,7 +39,7 @@
 	 * 
 	 * @see #hasNext
 	 */
-	public Object next();
+	public E next();
 
 	/**
 	 * Removes the last object returned by <code>next</code> from the

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java Thu Apr 13 06:08:58 2006
@@ -20,7 +20,7 @@
  * List is a collection which maintains an ordering for its elements. Every
  * element in the list has an index.
  */
-public interface List extends Collection {
+public interface List<E> extends Collection<E> {
 	/**
 	 * Inserts the specified object into this Vector at the specified location.
 	 * The object is inserted before any previous element at the specified
@@ -42,7 +42,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public void add(int location, Object object);
+	public void add(int location, E object);
 
 	/**
 	 * Adds the specified object at the end of this List.
@@ -59,7 +59,7 @@
 	 * @exception IllegalArgumentException
 	 *                when the object cannot be added to this List
 	 */
-	public boolean add(Object object);
+	public boolean add(E object);
 
 	/**
 	 * Inserts the objects in the specified Collection at the specified location
@@ -81,7 +81,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public boolean addAll(int location, Collection collection);
+	public boolean addAll(int location, Collection<? extends E> collection);
 
 	/**
 	 * Adds the objects in the specified Collection to the end of this List. The
@@ -99,7 +99,7 @@
 	 * @exception IllegalArgumentException
 	 *                when an object cannot be added to this List
 	 */
-	public boolean addAll(Collection collection);
+	public boolean addAll(Collection<? extends E> collection);
 
 	/**
 	 * Removes all elements from this List, leaving it empty.
@@ -129,7 +129,7 @@
 	 * @return true if all objects in the specified Collection are elements of
 	 *         this List, false otherwise
 	 */
-	public boolean containsAll(Collection collection);
+	public boolean containsAll(Collection<?> collection);
 
 	/**
 	 * Compares the argument to the receiver, and answers true if they represent
@@ -153,7 +153,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object get(int location);
+	public E get(int location);
 
 	/**
 	 * Answers an integer hash code for the receiver. Objects which are equal
@@ -192,7 +192,7 @@
 	 * 
 	 * @see Iterator
 	 */
-	public Iterator iterator();
+	public Iterator<E> iterator();
 
 	/**
 	 * Searches this List for the specified object and returns the index of the
@@ -212,7 +212,7 @@
 	 * 
 	 * @see ListIterator
 	 */
-	public ListIterator listIterator();
+	public ListIterator<E> listIterator();
 
 	/**
 	 * Answers a ListIterator on the elements of this List. The elements are
@@ -228,7 +228,7 @@
 	 * 
 	 * @see ListIterator
 	 */
-	public ListIterator listIterator(int location);
+	public ListIterator<E> listIterator(int location);
 
 	/**
 	 * Removes the object at the specified location from this List.
@@ -242,7 +242,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object remove(int location);
+	public E remove(int location);
 
 	/**
 	 * Removes the first occurrence of the specified object from this List.
@@ -254,7 +254,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this List is not supported
 	 */
-	public boolean remove(Object object);
+	public boolean remove(E object);
 
 	/**
 	 * Removes all occurrences in this List of each object in the specified
@@ -267,7 +267,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this List is not supported
 	 */
-	public boolean removeAll(Collection collection);
+	public boolean removeAll(Collection<?> collection);
 
 	/**
 	 * Removes all objects from this List that are not contained in the
@@ -280,7 +280,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this List is not supported
 	 */
-	public boolean retainAll(Collection collection);
+	public boolean retainAll(Collection<?> collection);
 
 	/**
 	 * Replaces the element at the specified location in this List with the
@@ -301,7 +301,7 @@
 	 * @exception IndexOutOfBoundsException
 	 *                when <code>location < 0 || >= size()</code>
 	 */
-	public Object set(int location, Object object);
+	public E set(int location, E object);
 
 	/**
 	 * Answers the number of elements in this List.
@@ -325,7 +325,7 @@
 	 *                when <code>start < 0, start > end</code> or
 	 *                <code>end > size()</code>
 	 */
-	public List subList(int start, int end);
+	public List<E> subList(int start, int end);
 
 	/**
 	 * Answers an array containing all elements contained in this List.
@@ -349,5 +349,5 @@
 	 *                when the type of an element in this List cannot be stored
 	 *                in the type of the specified array
 	 */
-	public Object[] toArray(Object[] array);
+	public <T> T[] toArray(T[] array);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListIterator.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListIterator.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListIterator.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListIterator.java Thu Apr 13 06:08:58 2006
@@ -20,7 +20,7 @@
  * An ListIterator is used to sequence over a List of objects. ListIterator can
  * move backwards or forwards through the List.
  */
-public interface ListIterator extends Iterator {
+public interface ListIterator<E> extends Iterator<E> {
 	
 	/**
 	 * Inserts the specified object into the list between <code>next</code>
@@ -37,7 +37,7 @@
 	 * @exception IllegalArgumentException
 	 *                when the object cannot be added to the list
 	 */
-	void add(Object object);
+	void add(E object);
 
 	/**
 	 * Answers if there are more elements to iterate.
@@ -67,7 +67,7 @@
 	 * 
 	 * @see #hasNext
 	 */
-	public Object next();
+	public E next();
 
 	/**
 	 * Answers the index of the next object in the iteration.
@@ -91,7 +91,7 @@
 	 * 
 	 * @see #hasPrevious
 	 */
-	public Object previous();
+	public E previous();
 
 	/**
 	 * Answers the index of the previous object in the iteration.
@@ -138,5 +138,5 @@
 	 *                <code>add</code> have already been called after the last
 	 *                call to <code>next</code> or <code>previous</code>
 	 */
-	void set(Object object);
+	void set(E object);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Map.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Map.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Map.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Map.java Thu Apr 13 06:08:58 2006
@@ -19,12 +19,12 @@
 /**
  * Map has a set of keys, each key is mapped to a single value.
  */
-public interface Map {
+public interface Map<K,V> {
 	/**
 	 * Map.Entry is a key/value mapping which is contained in a Map.
 	 * 
 	 */
-	public abstract static interface Entry {
+	public abstract static interface Entry<K,V> {
 		/**
 		 * Compares the specified object to this Map.Entry and answer if they
 		 * are equal. The object must be an instance of Map.Entry and have the
@@ -44,14 +44,14 @@
 		 * 
 		 * @return the key
 		 */
-		public Object getKey();
+		public K getKey();
 
 		/**
 		 * Gets the value.
 		 * 
 		 * @return the value
 		 */
-		public Object getValue();
+		public V getValue();
 
 		/**
 		 * Answers an integer hash code for the receiver. Objects which are
@@ -70,7 +70,7 @@
 		 *            the new value
 		 * @return object
 		 */
-		public Object setValue(Object object);
+		public V setValue(V object);
 	};
 
 	/**
@@ -91,7 +91,7 @@
 	 *            the object to search for
 	 * @return true if <code>key</code> is a key of this Map, false otherwise
 	 */
-	public boolean containsKey(Object key);
+	public boolean containsKey(K key);
 
 	/**
 	 * Searches this Map for the specified value.
@@ -101,7 +101,7 @@
 	 * @return true if <code>value</code> is a value of this Map, false
 	 *         otherwise
 	 */
-	public boolean containsValue(Object value);
+	public boolean containsValue(V value);
 
 	/**
 	 * Returns a <code>Set</code> whose elements comprise all of the mappings
@@ -113,7 +113,7 @@
 	 * 
 	 * @return a <code>Set</code> of the mappings
 	 */
-	public Set entrySet();
+	public Set<Map.Entry<K,V>> entrySet();
 
 	/**
 	 * Compares the argument to the receiver, and answers true if they represent
@@ -134,7 +134,7 @@
 	 *            the key
 	 * @return the value of the mapping with the specified key
 	 */
-	public Object get(Object key);
+	public V get(K key);
 
 	/**
 	 * Answers an integer hash code for the receiver. Objects which are equal
@@ -162,7 +162,7 @@
 	 * 
 	 * @return a Set of the keys
 	 */
-	public Set keySet();
+	public Set<K> keySet();
 
 	/**
 	 * Maps the specified key to the specified value.
@@ -185,7 +185,7 @@
 	 *                when the key or value is null and this Map does not
 	 *                support null keys or values
 	 */
-	public Object put(Object key, Object value);
+	public V put(K key, V value);
 
 	/**
 	 * Copies every mapping in the specified Map to this Map.
@@ -204,7 +204,7 @@
 	 *                when a key or value is null and this Map does not support
 	 *                null keys or values
 	 */
-	public void putAll(Map map);
+	public void putAll(Map<? extends K,? extends V> map);
 
 	/**
 	 * Removes a mapping with the specified key from this Map.
@@ -217,7 +217,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Map is not supported
 	 */
-	public Object remove(Object key);
+	public V remove(K key);
 
 	/**
 	 * Answers the number of elements in this Map.
@@ -234,5 +234,5 @@
 	 * 
 	 * @return a Collection of the values
 	 */
-	public Collection values();
+	public Collection<V> values();
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MapEntry.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MapEntry.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MapEntry.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MapEntry.java Thu Apr 13 06:08:58 2006
@@ -19,19 +19,20 @@
 /**
  * MapEntry is an internal class which provides an implementation of Map.Entry.
  */
-class MapEntry implements Map.Entry, Cloneable {
+class MapEntry<K,V> implements Map.Entry<K,V>, Cloneable {
 	
-	Object key, value;
+	K key;
+    V value;
 
 	interface Type {
 		Object get(MapEntry entry);
 	}
 
-	MapEntry(Object theKey) {
+	MapEntry(K theKey) {
 		key = theKey;
 	}
 
-	MapEntry(Object theKey, Object theValue) {
+	MapEntry(K theKey, V theValue) {
 		key = theKey;
 		value = theValue;
 	}
@@ -57,11 +58,11 @@
 			return false;
 	}
 
-	public Object getKey() {
+	public K getKey() {
 		return key;
 	}
 
-	public Object getValue() {
+	public V getValue() {
 		return value;
 	}
 
@@ -70,8 +71,8 @@
 				^ (value == null ? 0 : value.hashCode());
 	}
 
-	public Object setValue(Object object) {
-		Object result = value;
+	public V setValue(V object) {
+		V result = value;
 		value = object;
 		return result;
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Properties.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Properties.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Properties.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Properties.java Thu Apr 13 06:08:58 2006
@@ -34,7 +34,7 @@
  * @see Hashtable
  * @see java.lang.System#getProperties
  */
-public class Properties extends Hashtable {
+public class Properties extends Hashtable<Object,Object> {
 	
 	private static final long serialVersionUID = 4112578634029874840L;
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Set.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Set.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Set.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Set.java Thu Apr 13 06:08:58 2006
@@ -19,7 +19,7 @@
 /**
  * Set is a collection which does not allow duplicate elements.
  */
-public interface Set extends Collection {
+public interface Set<E> extends Collection<E> {
 	
 	/**
 	 * Adds the specified object to this Set. The Set is not modified if it
@@ -36,7 +36,7 @@
 	 * @exception IllegalArgumentException
 	 *                when the object cannot be added to this Set
 	 */
-	public boolean add(Object object);
+	public boolean add(E object);
 
 	/**
 	 * Adds the objects in the specified Collection which do not exist in this
@@ -53,7 +53,7 @@
 	 * @exception IllegalArgumentException
 	 *                when an object cannot be added to this Set
 	 */
-	public boolean addAll(Collection collection);
+	public boolean addAll(Collection<? extends E> collection);
 
 	/**
 	 * Removes all elements from this Set, leaving it empty.
@@ -83,7 +83,7 @@
 	 * @return true if all objects in the specified Collection are elements of
 	 *         this Set, false otherwise
 	 */
-	public boolean containsAll(Collection collection);
+	public boolean containsAll(Collection<?> collection);
 
 	/**
 	 * Compares the argument to the receiver, and answers true if they represent
@@ -147,7 +147,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Set is not supported
 	 */
-	public boolean removeAll(Collection collection);
+	public boolean removeAll(Collection<?> collection);
 
 	/**
 	 * Removes all objects from this Set that are not contained in the specified
@@ -160,7 +160,7 @@
 	 * @exception UnsupportedOperationException
 	 *                when removing from this Set is not supported
 	 */
-	public boolean retainAll(Collection collection);
+	public boolean retainAll(Collection<?> collection);
 
 	/**
 	 * Answers the number of elements in this Set.
@@ -191,5 +191,5 @@
 	 *                when the type of an element in this Set cannot be stored
 	 *                in the type of the specified array
 	 */
-	public Object[] toArray(Object[] array);
+	public <T> T[] toArray(T[] array);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security-kernel/src/main/java/java/security/AccessController.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security-kernel/src/main/java/java/security/AccessController.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security-kernel/src/main/java/java/security/AccessController.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security-kernel/src/main/java/java/security/AccessController.java Thu Apr 13 06:08:58 2006
@@ -108,7 +108,7 @@
 	 * Used to keep the context live during doPrivileged().
 	 * 
 	 * 
-	 * @see #doPrivileged(PrivilegedAction, AccessControlContext)
+	 * @see #doPrivileged(PrivilegedAction<T>, AccessControlContext)
 	 */
 	private static void keepalive(AccessControlContext context) {
 	}
@@ -183,9 +183,9 @@
 	 * chain.
 	 * 
 	 * 
-	 * @see #doPrivileged(PrivilegedAction)
+	 * @see #doPrivileged(PrivilegedAction<T>)
 	 */
-	public static Object doPrivileged(PrivilegedAction action) {
+	public static <T> T doPrivileged(PrivilegedAction<T> action) {
 		return action.run();
 	}
 
@@ -203,11 +203,11 @@
 	 * chain.
 	 * 
 	 * 
-	 * @see #doPrivileged(PrivilegedAction)
+	 * @see #doPrivileged(PrivilegedAction<T>)
 	 */
-	public static Object doPrivileged(PrivilegedAction action,
+	public static <T> T doPrivileged(PrivilegedAction<T> action,
 			AccessControlContext context) {
-		Object result = action.run();
+		T result = action.run();
 		keepalive(context);
 		return result;
 	}
@@ -225,9 +225,9 @@
 	 * PrivilegedActionExceptions
 	 * 
 	 * 
-	 * @see #doPrivileged(PrivilegedAction)
+	 * @see #doPrivileged(PrivilegedAction<T>)
 	 */
-	public static Object doPrivileged(PrivilegedExceptionAction action)
+	public static <T> T doPrivileged(PrivilegedExceptionAction<T> action)
 			throws PrivilegedActionException {
 		try {
 			return action.run();
@@ -253,12 +253,12 @@
 	 * PrivilegedActionExceptions
 	 * 
 	 * 
-	 * @see #doPrivileged(PrivilegedAction)
+	 * @see #doPrivileged(PrivilegedAction<T>)
 	 */
-	public static Object doPrivileged(PrivilegedExceptionAction action,
+	public static <T> T doPrivileged(PrivilegedExceptionAction<T> action,
 			AccessControlContext context) throws PrivilegedActionException {
 		try {
-			Object result = action.run();
+			T result = action.run();
 			keepalive(context);
 			return result;
 		} catch (RuntimeException ex) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParameters.java Thu Apr 13 06:08:58 2006
@@ -187,7 +187,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public final AlgorithmParameterSpec getParameterSpec(Class paramSpec)
+    public final <T extends AlgorithmParameterSpec> T getParameterSpec(Class<T> paramSpec)
             throws InvalidParameterSpecException {
         if (!initialized) {
             throw new InvalidParameterSpecException(

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParametersSpi.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParametersSpi.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParametersSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/AlgorithmParametersSpi.java Thu Apr 13 06:08:58 2006
@@ -56,8 +56,8 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    protected abstract AlgorithmParameterSpec engineGetParameterSpec(
-            Class paramSpec) throws InvalidParameterSpecException;
+    protected abstract <T extends AlgorithmParameterSpec> T engineGetParameterSpec(
+            Class<T> paramSpec) throws InvalidParameterSpecException;
 
     //    FIXME 1.5 signature: protected abstract <T extends
     // AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> paramSpec)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/IdentityScope.java Thu Apr 13 06:08:58 2006
@@ -122,7 +122,7 @@
      * @com.intel.drl.spec_ref 
      * TODO change in 1.5
      */
-    public abstract Enumeration identities();
+    public abstract Enumeration<Identity> identities();
 
     /**
      * @com.intel.drl.spec_ref 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactory.java Thu Apr 13 06:08:58 2006
@@ -149,8 +149,8 @@
      * @com.intel.drl.spec_ref
      * 
      */
-    public final KeySpec getKeySpec(Key key,
-                                    Class keySpec)
+    public final <T extends KeySpec> T getKeySpec(Key key,
+                                    Class<T> keySpec)
                             throws InvalidKeySpecException {
         return spiImpl.engineGetKeySpec(key, keySpec);
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactorySpi.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactorySpi.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactorySpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyFactorySpi.java Thu Apr 13 06:08:58 2006
@@ -50,7 +50,7 @@
      * @com.intel.drl.spec_ref
      * 
      */
-    protected abstract KeySpec engineGetKeySpec(Key key, Class keySpec)
+    protected abstract <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec)
                                     throws InvalidKeySpecException;
     //FIXME 1.5 signature: protected abstract <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException
     

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyRep.java Thu Apr 13 06:08:58 2006
@@ -21,128 +21,128 @@
 
 package java.security;
 
-//import java.io.IOException;
-//import java.io.NotSerializableException;
-//import java.io.ObjectInputStream;
-//import java.io.ObjectStreamException;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamException;
 import java.io.Serializable;
-//import java.security.spec.X509EncodedKeySpec;
-//import java.security.spec.PKCS8EncodedKeySpec;
-//import java.security.spec.InvalidKeySpecException;
-//
-//import javax.crypto.spec.SecretKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.InvalidKeySpecException;
+
+import javax.crypto.spec.SecretKeySpec;
 
 /**
  * @com.intel.drl.spec_ref
  * 
  */
 public class KeyRep implements Serializable {
-//    /**
-//     * @com.intel.drl.spec_ref
-//     */
-//    private static final long serialVersionUID = -4757683898830641853L;
-//    // Key type
-//    private final Type type;
-//    // Key algorithm name
-//    private final String algorithm;
-//    // Key encoding format
-//    private final String format;
-//    // Key encoding
-//    private byte[] encoded;
-//
-//    /**
-//     * @com.intel.drl.spec_ref
-//     */
-//    public KeyRep(Type type,
-//            String algorithm, String format, byte[] encoded) {
-//        this.type = type;
-//        this.algorithm = algorithm;
-//        this.format = format;
-//        this.encoded = encoded;
-//        if(this.type == null) {
-//            throw new NullPointerException("the type parameter is null");
-//        }
-//        if(this.algorithm == null) {
-//            throw new NullPointerException("the algorithm parameter is null");
-//        }
-//        if(this.format == null) {
-//            throw new NullPointerException("the format parameter is null");
-//        }
-//        if(this.encoded == null) {
-//            throw new NullPointerException("the encoded parameter is null");
-//        }
-//    }
-//
-//    /**
-//     * @com.intel.drl.spec_ref
-//     */
-//    protected Object readResolve() throws ObjectStreamException {
-//        switch (type) {
-//        case SECRET:
-//            if ("RAW".equals(format)) {
-//                try {
-//                    return new SecretKeySpec(encoded, algorithm);
-//                } catch (IllegalArgumentException e) {
-//                    throw new NotSerializableException(
-//                            "Could not create SecretKeySpec: " + e);
-//                }
-//            }
-//            throw new NotSerializableException(
-//                "unrecognized type/format combination: " +
-//                type + "/" + format);
-//        case PUBLIC:
-//            if ("X.509".equals(format)) {
-//                try {
-//                    KeyFactory kf = KeyFactory.getInstance(algorithm);
-//                    return kf.generatePublic(new X509EncodedKeySpec(encoded));
-//                } catch (NoSuchAlgorithmException e) {
-//                    throw new NotSerializableException(
-//                            "Could not resolute key: " + e);
-//                }
-//                catch (InvalidKeySpecException e) {
-//                    throw new NotSerializableException(
-//                            "Could not resolute key: " + e);
-//                }
-//            }
-//            throw new NotSerializableException(
-//                "unrecognized type/format combination: " +
-//                type + "/" + format);
-//        case PRIVATE:
-//            if ("PKCS#8".equals(format)) {
-//                try {
-//                    KeyFactory kf = KeyFactory.getInstance(algorithm);
-//                    return kf.generatePrivate(new PKCS8EncodedKeySpec(encoded));
-//                } catch (NoSuchAlgorithmException e) {
-//                    throw new NotSerializableException(
-//                            "Could not resolute key: " + e);
-//                }
-//                catch (InvalidKeySpecException e) {
-//                    throw new NotSerializableException(
-//                            "Could not resolute key: " + e);
-//                }
-//            }
-//            throw new NotSerializableException(
-//                "unrecognized type/format combination: " +
-//                type + "/" + format);
-//        }
-//        throw new NotSerializableException("unrecognized key type: " + type);
-//    }
-//
-//    // Makes deffensive copy of key encoding
-//    private void readObject(ObjectInputStream is)
-//        throws IOException, ClassNotFoundException {
-//        is.defaultReadObject();
-//        new_encoded = new byte[encoded.length];
-//        System.arraycopy(encoded, 0, new_encoded, 0, new_encoded.length);
-//        encoded = new_encoded;    
-//    }
-//
-//    /**
-//     * Supported key types
-//     */
-//    public static enum Type {
-//        SECRET,
-//        PUBLIC,
-//        PRIVATE;
-//    }
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    private static final long serialVersionUID = -4757683898830641853L;
+    // Key type
+    private final Type type;
+    // Key algorithm name
+    private final String algorithm;
+    // Key encoding format
+    private final String format;
+    // Key encoding
+    private byte[] encoded;
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    public KeyRep(Type type,
+            String algorithm, String format, byte[] encoded) {
+        this.type = type;
+        this.algorithm = algorithm;
+        this.format = format;
+        this.encoded = encoded;
+        if(this.type == null) {
+            throw new NullPointerException("the type parameter is null");
+        }
+        if(this.algorithm == null) {
+            throw new NullPointerException("the algorithm parameter is null");
+        }
+        if(this.format == null) {
+            throw new NullPointerException("the format parameter is null");
+        }
+        if(this.encoded == null) {
+            throw new NullPointerException("the encoded parameter is null");
+        }
+    }
+
+    /**
+     * @com.intel.drl.spec_ref
+     */
+    protected Object readResolve() throws ObjectStreamException {
+        switch (type) {
+        case SECRET:
+            if ("RAW".equals(format)) {
+                try {
+                    return new SecretKeySpec(encoded, algorithm);
+                } catch (IllegalArgumentException e) {
+                    throw new NotSerializableException(
+                            "Could not create SecretKeySpec: " + e);
+                }
+            }
+            throw new NotSerializableException(
+                "unrecognized type/format combination: " +
+                type + "/" + format);
+        case PUBLIC:
+            if ("X.509".equals(format)) {
+                try {
+                    KeyFactory kf = KeyFactory.getInstance(algorithm);
+                    return kf.generatePublic(new X509EncodedKeySpec(encoded));
+                } catch (NoSuchAlgorithmException e) {
+                    throw new NotSerializableException(
+                            "Could not resolute key: " + e);
+                }
+                catch (InvalidKeySpecException e) {
+                    throw new NotSerializableException(
+                            "Could not resolute key: " + e);
+                }
+            }
+            throw new NotSerializableException(
+                "unrecognized type/format combination: " +
+                type + "/" + format);
+        case PRIVATE:
+            if ("PKCS#8".equals(format)) {
+                try {
+                    KeyFactory kf = KeyFactory.getInstance(algorithm);
+                    return kf.generatePrivate(new PKCS8EncodedKeySpec(encoded));
+                } catch (NoSuchAlgorithmException e) {
+                    throw new NotSerializableException(
+                            "Could not resolute key: " + e);
+                }
+                catch (InvalidKeySpecException e) {
+                    throw new NotSerializableException(
+                            "Could not resolute key: " + e);
+                }
+            }
+            throw new NotSerializableException(
+                "unrecognized type/format combination: " +
+                type + "/" + format);
+        }
+        throw new NotSerializableException("unrecognized key type: " + type);
+    }
+
+    // Makes deffensive copy of key encoding
+    private void readObject(ObjectInputStream is)
+        throws IOException, ClassNotFoundException {
+        is.defaultReadObject();
+        byte[] new_encoded = new byte[encoded.length];
+        System.arraycopy(encoded, 0, new_encoded, 0, new_encoded.length);
+        encoded = new_encoded;    
+    }
+
+    /**
+     * Supported key types
+     */
+    public static enum Type {
+        SECRET,
+        PUBLIC,
+        PRIVATE
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStore.java Thu Apr 13 06:08:58 2006
@@ -309,7 +309,7 @@
      * 
      * FIXME: update to Enumeration <String>
      */
-    public final Enumeration aliases() throws KeyStoreException {
+    public final Enumeration<String> aliases() throws KeyStoreException {
         if (!isInit) {
             throw new KeyStoreException(NOTINITKEYSTORE);
         }
@@ -487,7 +487,8 @@
      * 
      * FIXME: for 1.5 update to Class <? extends KeyStore.Entry>
      */
-    public final boolean entryInstanceOf(String alias, Class entryClass)
+    public final boolean entryInstanceOf(String alias, 
+            Class<? extends KeyStore.Entry> entryClass)
             throws KeyStoreException {
         if (alias == null)
             throw new NullPointerException("alias is null");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/KeyStoreSpi.java Thu Apr 13 06:08:58 2006
@@ -104,7 +104,7 @@
      * 
      * FIXME: 1.5 updates are needed Enumeration <String>
      */
-    public abstract Enumeration engineAliases();
+    public abstract Enumeration<String> engineAliases();
 
     /**
      * @com.intel.drl.spec_ref
@@ -303,7 +303,8 @@
      * 
      * FIXME: 1.5 updates Class <? extends KeyStore.Entry> should be done
      */
-    public boolean engineEntryInstanceOf(String alias, Class entryClass) {
+    public boolean engineEntryInstanceOf(String alias, 
+            Class<? extends KeyStore.Entry> entryClass) {
         if (!engineContainsAlias(alias)) {
             return false;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java Thu Apr 13 06:08:58 2006
@@ -49,7 +49,7 @@
     /**
      * @com.intel.drl.spec_ref
      */
-    public abstract Enumeration elements();
+    public abstract Enumeration<Permission> elements();
 
     /**
      * @com.intel.drl.spec_ref

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedAction.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedAction.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedAction.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedAction.java Thu Apr 13 06:08:58 2006
@@ -25,9 +25,9 @@
  * @com.intel.drl.spec_ref 
  */
 
-public interface PrivilegedAction {
+public interface PrivilegedAction<T> {
     /**
      * @com.intel.drl.spec_ref 
      */
-    public Object run();
+    public T run();
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedExceptionAction.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedExceptionAction.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedExceptionAction.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PrivilegedExceptionAction.java Thu Apr 13 06:08:58 2006
@@ -24,9 +24,9 @@
 /**
  * @com.intel.drl.spec_ref
  */
-public interface PrivilegedExceptionAction {
+public interface PrivilegedExceptionAction<T> {
     /**
      * @com.intel.drl.spec_ref
      */
-    Object run() throws Exception;
+    T run() throws Exception;
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java?rev=393797&r1=393796&r2=393797&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Provider.java Thu Apr 13 06:08:58 2006
@@ -198,7 +198,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public synchronized void putAll(Map t) {
+    public synchronized void putAll(Map<?,?> t) {
 
         // Implementation note:
         // checkSecurityAccess method call is NOT specified
@@ -211,7 +211,7 @@
         myPutAll(t);
     }
 
-    private void myPutAll(Map t) {
+    private void myPutAll(Map<?,?> t) {
         if (changedProperties == null) {
             changedProperties = new Properties();
         }
@@ -242,7 +242,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public synchronized Set entrySet() {
+    public synchronized Set<Map.Entry<Object,Object>> entrySet() {
         return Collections.unmodifiableSet(super.entrySet());
     }
 
@@ -250,7 +250,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public Set keySet() {
+    public Set<Object> keySet() {
         return Collections.unmodifiableSet(super.keySet());
     }
 
@@ -258,7 +258,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public Collection values() {
+    public Collection<Object> values() {
         return Collections.unmodifiableCollection(super.values());
     }
 
@@ -460,7 +460,7 @@
      * @com.intel.drl.spec_ref
      *  
      */
-    public synchronized Set getServices() {
+    public synchronized Set<Provider.Service> getServices() {
         //FIXME 1.5 signature public Set<Provider.Service> getServices() {
         updatePropertyServiceTable();
         if (lastServicesSet != null) {
@@ -648,8 +648,8 @@
 
     // Update provider Servises if the properties was changed
     private void updatePropertyServiceTable() {
-        Object key;
-        Object value;
+        Object _key;
+        Object _value;
         Provider.Service s;
         String serviceName;
         String algorithm;
@@ -659,20 +659,21 @@
         for (Iterator it = changedProperties.entrySet().iterator(); it
                 .hasNext();) {
             Map.Entry entry = (Map.Entry) it.next();
-            key = entry.getKey();
-            value = entry.getValue();
-            if (key == null || value == null || !(key instanceof String)
-                    || !(value instanceof String)) {
+            _key = entry.getKey();
+            _value = entry.getValue();
+            if (_key == null || _value == null || !(_key instanceof String)
+                    || !(_value instanceof String)) {
                 continue;
             }
-            String k = (String) key;
-            if (k.startsWith("Provider")) { // Provider service type is reserved
+            String key = (String) _key;
+            String value = (String) _value;
+            if (key.startsWith("Provider")) { // Provider service type is reserved
                 continue;
             }
             int i;
-            if (k.startsWith("Alg.Alias.")) { // Alg.Alias.<crypto_service>.<aliasName>=<stanbdardName>
+            if (key.startsWith("Alg.Alias.")) { // Alg.Alias.<crypto_service>.<aliasName>=<stanbdardName>
                 String aliasName;
-                String service_alias = k.substring(10);
+                String service_alias = key.substring(10);
                 i = service_alias.indexOf(".");
                 serviceName = service_alias.substring(0, i);
                 aliasName = service_alias.substring(i + 1);
@@ -713,14 +714,14 @@
                 }
                 continue;
             }
-            int j = k.indexOf(".");
+            int j = key.indexOf(".");
             if (j == -1) { // unknown format
                 continue;
             }
-            i = k.indexOf(" ");
+            i = key.indexOf(" ");
             if (i == -1) { // <crypto_service>.<algorithm_or_type>=<className>
-                serviceName = k.substring(0, j);
-                algorithm = k.substring(j + 1);
+                serviceName = key.substring(0, j);
+                algorithm = key.substring(j + 1);
                 String alg = algorithm.toUpperCase();
                 Object o = null;
                 if (propertyServiceTable != null) {
@@ -743,9 +744,9 @@
                 }
             } else { // <crypto_service>.<algorithm_or_type>
                      // <attribute_name>=<attrValue>
-                serviceName = k.substring(0, j);
-                algorithm = k.substring(j + 1, i);
-                String attribute = k.substring(i + 1);
+                serviceName = key.substring(0, j);
+                algorithm = key.substring(j + 1, i);
+                String attribute = key.substring(i + 1);
                 String alg = algorithm.toUpperCase();
                 Object o = null;
                 if (propertyServiceTable != null) {
@@ -830,10 +831,10 @@
         private String className;
 
         // The aliases
-        private List aliases;
+        private List<String> aliases;
 
         // The attributes
-        private Map attributes;
+        private Map<String,String> attributes;
 
         // Service implementation
         private Class implementation = null;
@@ -846,7 +847,7 @@
          *  
          */
         public Service(Provider provider, String type, String algorithm,
-                String className, List aliases, Map attributes) {
+                String className, List<String> aliases, Map<String,String> attributes) {
             if (provider == null || type == null || algorithm == null
                     || className == null) {
                 throw new NullPointerException();
@@ -902,7 +903,7 @@
             if (attributes == null) {
                 return null;
             }
-            return (String) attributes.get(name);
+            return attributes.get(name);
         }
 
         Iterator getAliases() {



Mime
View raw message