harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r410673 - in /incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming: CannotProceedException.java Context.java InitialContext.java NamingEnumeration.java Reference.java ReferralException.java spi/NamingManager.java
Date Wed, 31 May 2006 21:18:56 GMT
Author: tellison
Date: Wed May 31 14:18:55 2006
New Revision: 410673

URL: http://svn.apache.org/viewvc?rev=410673&view=rev
Log:
Generics uplift in JNDI

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CannotProceedException.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Context.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/NamingEnumeration.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Reference.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ReferralException.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CannotProceedException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CannotProceedException.java?rev=410673&r1=410672&r2=410673&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CannotProceedException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CannotProceedException.java
Wed May 31 14:18:55 2006
@@ -102,7 +102,7 @@
      * be manipulated using <code>getEnvironment</code> 
      * and <code>setEnvironment methods</code>. 
      */
-    protected Hashtable environment = null;
+    protected Hashtable<?, ?> environment = null;
 
     /**
      * Contains a composite name that is the unresolved part of the new name 
@@ -174,7 +174,7 @@
      * @return the value of the protected field <code>environment</code> 
      * which may be null.
      */
-    public Hashtable getEnvironment() {
+    public Hashtable<?, ?> getEnvironment() {
         return environment;
     }
 
@@ -213,7 +213,7 @@
      * 
      * @param hashtable the new environment to set.
      */
-    public void setEnvironment(Hashtable hashtable) {
+    public void setEnvironment(Hashtable<?, ?> hashtable) {
         environment = hashtable;
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Context.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Context.java?rev=410673&r1=410672&r2=410673&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Context.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Context.java
Wed May 31 14:18:55 2006
@@ -602,7 +602,7 @@
      *          this context, which should not be modified
      * @throws NamingException if an error occurs.
      */
-    public Hashtable getEnvironment() throws NamingException;
+    public Hashtable<?, ?> getEnvironment() throws NamingException;
 
     /**
      * Returns the complete name as a string for this context in the 
@@ -674,7 +674,7 @@
      *          specified name excluding any bindings for any subcontexts
      * @throws NamingException if an error occurs.
      */
-    public NamingEnumeration list(String s) throws NamingException;
+    public NamingEnumeration<NameClassPair> list(String s) throws NamingException;
 
     /**
      * Returns an enumeration of the bindings of the context for the specified
@@ -688,7 +688,7 @@
      *          name excluding any bindings for any subcontexts
      * @throws NamingException if an error occurs.
      */
-    public NamingEnumeration listBindings(Name n) throws NamingException;
+    public NamingEnumeration<Binding> listBindings(Name n) throws NamingException;
 
     /**
      * Returns an enumeration of the bindings of the context for the specified
@@ -702,7 +702,7 @@
      *          name excluding any bindings for any subcontexts
      * @throws NamingException if an error occurs.
      */
-    public NamingEnumeration listBindings(String s) throws NamingException;
+    public NamingEnumeration<Binding> listBindings(String s) throws NamingException;
 
     /**
      * Returns the object bound to the specified name in this context. If the

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java?rev=410673&r1=410672&r2=410673&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
Wed May 31 14:18:55 2006
@@ -186,7 +186,7 @@
      *                          the context 
      * @throws NamingException  If failed to create an InitialContext.
      */
-    private void internalInit(Hashtable env) throws NamingException {
+    private void internalInit(Hashtable<?, ?> env) throws NamingException {
 
         // 1. Read the environment parameter used to create this Context
         if (null == env) {
@@ -232,7 +232,7 @@
      * @throws NamingException  If naming problems are encountered during
      *                          initialization of these fields.
      */
-    protected void init(Hashtable env) throws NamingException {
+    protected void init(Hashtable<?, ?> env) throws NamingException {
         this.internalInit(env);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/NamingEnumeration.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/NamingEnumeration.java?rev=410673&r1=410672&r2=410673&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/NamingEnumeration.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/NamingEnumeration.java
Wed May 31 14:18:55 2006
@@ -1,4 +1,4 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+/* Copyright 2004, 2006 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.
@@ -26,7 +26,7 @@
  * more elements or on closing the <code>Enumeration</code>.
  * 
  */
-public interface NamingEnumeration extends Enumeration {
+public interface NamingEnumeration<T> extends Enumeration<T> {
 
     /*
      * -------------------------------------------------------------------
@@ -41,7 +41,7 @@
      * @exception NamingException if a naming error occurs
      * @exception java.util.NoSuchElementException when no more elements exist.
      */
-    public Object next() throws NamingException;
+    public T next() throws NamingException;
 
     /**
      * Check for more elements.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Reference.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Reference.java?rev=410673&r1=410672&r2=410673&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Reference.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Reference.java
Wed May 31 14:18:55 2006
@@ -203,7 +203,7 @@
      *  
      * @return              an enumeration of all the addresses
      */
-    public Enumeration getAll() {
+    public Enumeration<RefAddr> getAll() {
         return addrs.elements();
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ReferralException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ReferralException.java?rev=410673&r1=410672&r2=410673&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ReferralException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ReferralException.java
Wed May 31 14:18:55 2006
@@ -89,7 +89,7 @@
      *          following a referral exception. This should not return null.
      * @throws  NamingException
      */
-    public abstract Context getReferralContext(Hashtable h) throws NamingException;
+    public abstract Context getReferralContext(Hashtable<?, ?> h) throws NamingException;
 
     /**
      * Returns the information relating to the exception. This should

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java?rev=410673&r1=410672&r2=410673&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/spi/NamingManager.java
Wed May 31 14:18:55 2006
@@ -750,9 +750,9 @@
 
         // set CPE property of the env
         if (cpe.getEnvironment() == null) {
-            cpe.setEnvironment(new Hashtable());
+            cpe.setEnvironment(new Hashtable<String, CannotProceedException>());
         }
-        cpe.getEnvironment().put(CPE, cpe);
+        ((Hashtable<String, CannotProceedException>)cpe.getEnvironment()).put(CPE,
cpe);
 
         // if resolved object is null
         if (null == cpe.getResolvedObj()) {
@@ -792,9 +792,8 @@
     private static Class classForName(final String className)
         throws ClassNotFoundException {
 
-        Class cls =
-            (Class) AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
+        Class cls = AccessController.doPrivileged(new PrivilegedAction<Class>() {
+            public Class run() {
                     // try thread context class loader first
     try {
                     return Class.forName(



Mime
View raw message