harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r410599 - in /incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming: CompositeName.java CompoundName.java InitialContext.java Name.java Reference.java
Date Wed, 31 May 2006 17:01:13 GMT
Author: tellison
Date: Wed May 31 10:01:12 2006
New Revision: 410599

URL: http://svn.apache.org/viewvc?rev=410599&view=rev
Log:
Generics update in javax.naming

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompositeName.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompoundName.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/Name.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Reference.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompositeName.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompositeName.java?rev=410599&r1=410598&r2=410599&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompositeName.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompositeName.java
Wed May 31 10:01:12 2006
@@ -145,7 +145,7 @@
      */
 
     /* a list holding elements */
-    private transient Vector elems;
+    private transient Vector<String> elems;
 
     /*
      * -------------------------------------------------------------------
@@ -158,8 +158,8 @@
      *
      * @param elements  a list of name elements
      */
-    private CompositeName(List elements) {
-        elems = new Vector(elements);
+    private CompositeName(List<String> elements) {
+        elems = new Vector<String>(elements);
     }
 
     /**
@@ -167,8 +167,8 @@
      *
      * @param elements  an enumeration of name elements
      */
-    protected CompositeName(Enumeration elements) {
-        elems = new Vector();
+    protected CompositeName(Enumeration<String> elements) {
+        elems = new Vector<String>();
         while (elements.hasMoreElements()) {
             elems.add(elements.nextElement());
         }
@@ -178,7 +178,7 @@
      * Default constructor, creates an empty name with zero elements.
      */
     public CompositeName() {
-        elems = new Vector();
+        elems = new Vector<String>();
     }
 
     /**
@@ -202,9 +202,9 @@
      * Parse string name elements. Delimiter is "/".
      * Escape is "\" and both single quote and double quote are supported.
      */
-    private static Vector parseName(String name) throws InvalidNameException {
+    private static Vector<String> parseName(String name) throws InvalidNameException
{
 
-        Vector l = new Vector();
+        Vector<String> l = new Vector<String>();
 
         // special case: all '/', means same number of empty elements
         if (isAllSlash(name)) {
@@ -357,7 +357,7 @@
      * -------------------------------------------------------------------
      */
 
-    public Enumeration getAll() {
+    public Enumeration<String> getAll() {
         return elems.elements();
     }
 
@@ -387,7 +387,7 @@
             throw new InvalidNameException("Must be a CompositeName"); //$NON-NLS-1$
         }
 
-        Enumeration enumeration = name.getAll();
+        Enumeration<String> enumeration = name.getAll();
         while (enumeration.hasMoreElements()) {
             elems.add(enumeration.nextElement());
         }
@@ -405,7 +405,7 @@
         if (index < 0 || index > elems.size()) {
             throw new ArrayIndexOutOfBoundsException();
         }
-        Enumeration enumeration = name.getAll();
+        Enumeration<String> enumeration = name.getAll();
         while (enumeration.hasMoreElements()) {
             elems.add(index++, enumeration.nextElement());
         }
@@ -547,7 +547,7 @@
         }
 
         // replicate fields
-        copy.elems = new Vector(elems);
+        copy.elems = new Vector<String>(elems);
         return copy;
     }
 
@@ -641,9 +641,9 @@
         ois.defaultReadObject();
 
         int size = ois.readInt();
-        elems = new Vector();
+        elems = new Vector<String>();
         for (int i = 0; i < size; i++) {
-            elems.add(ois.readObject());
+            elems.add((String)ois.readObject());
         }
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompoundName.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompoundName.java?rev=410599&r1=410598&r2=410599&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompoundName.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/CompoundName.java
Wed May 31 10:01:12 2006
@@ -305,7 +305,7 @@
     private transient boolean flat;
 
     //elements of compound name
-    private transient Vector elem;
+    private transient Vector<String> elem;
 
     //property setting
     protected transient Properties mySyntax;
@@ -332,12 +332,12 @@
      * 						If empty, the direction defaults to flat and no 
      * 						other properties are required.
      */
-    protected CompoundName(Enumeration elements, Properties props) {
+    protected CompoundName(Enumeration<String> elements, Properties props) {
         if (null == props || null == elements) {
             throw new NullPointerException();
         }
         init(props);
-        this.elem = new Vector();
+        this.elem = new Vector<String>();
         while (elements.hasMoreElements()) {
             this.elem.add(elements.nextElement());
         }
@@ -430,7 +430,7 @@
      * parse name from string to elements
      */
     private void parseName(String s) throws InvalidNameException {
-        this.elem = new Vector();
+        this.elem = new Vector<String>();
         if ("".equals(s)) { //$NON-NLS-1$
             // if empty string, return empty vector
             return;
@@ -611,7 +611,7 @@
      * Methods of interface Name
      * -------------------------------------------------------------------
      */
-    public Enumeration getAll() {
+    public Enumeration<String> getAll() {
         return this.elem.elements();
     }
 
@@ -633,13 +633,13 @@
 
     public Name getPrefix(int index) {
         validateIndex(index, true);
-        return new CompoundName(new Vector(elem.subList(0, index)).elements(),
+        return new CompoundName(new Vector<String>(elem.subList(0, index)).elements(),
                 mySyntax);
     }
 
     public Name getSuffix(int index) {
         validateIndex(index, false);
-        return new CompoundName(new Vector(elem.subList(index, elem.size()))
+        return new CompoundName(new Vector<String>(elem.subList(index, elem.size()))
                 .elements(), mySyntax);
     }
 
@@ -653,7 +653,7 @@
                     + " is not a compound name."); //$NON-NLS-1$
         }
         validateIndex(index, true);
-        Enumeration enumeration = name.getAll();
+        Enumeration<String> enumeration = name.getAll();
         while (enumeration.hasMoreElements()) {
             elem.add(index++, enumeration.nextElement());
         }
@@ -708,7 +708,7 @@
             throw new Error("Failed to clone object of CompoundName class"); //$NON-NLS-1$
         }
         newName.mySyntax = (Properties) mySyntax.clone();
-        newName.elem = (Vector) elem.clone();
+        newName.elem = (Vector<String>) elem.clone();
         return newName;
     }
 
@@ -782,9 +782,9 @@
         ois.defaultReadObject();
         init(((Properties) ois.readObject()));
         int size = ois.readInt();
-        elem = new Vector();
+        elem = new Vector<String>();
         for (int i = 0; i < size; i++) {
-            elem.add(ois.readObject());
+            elem.add((String)ois.readObject());
         }
     }
 

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=410599&r1=410598&r2=410599&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 10:01:12 2006
@@ -119,7 +119,7 @@
      * of the the sources of JNDI environment properties.
      * Initially null.
      */
-    protected Hashtable myProps;
+    protected Hashtable<String, Object> myProps;
 
     /*
      * -------------------------------------------------------------------
@@ -190,9 +190,9 @@
 
         // 1. Read the environment parameter used to create this Context
         if (null == env) {
-            myProps = new Hashtable();
+            myProps = new Hashtable<String, Object>();
         } else {
-            myProps = (Hashtable) env.clone();
+            myProps = (Hashtable<String, Object>) env.clone();
         }
 
         // 2. Read Applet parameters

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Name.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Name.java?rev=410599&r1=410598&r2=410599&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Name.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/Name.java
Wed May 31 10:01:12 2006
@@ -40,7 +40,12 @@
  * @see CompoundName
  */
 public interface Name extends Cloneable, Serializable {
-
+
+    /*
+     * SUID declared publically in the spec.
+     */
+    public static final long serialVersionUID = -3617482732056931635L;
+    
     /*
      * -------------------------------------------------------------------
      * Methods
@@ -54,7 +59,7 @@
      * 
      * @return an enumeration of <code>Name</code> elements - cannot be null
      */
-    public Enumeration getAll();
+    public Enumeration<String> getAll();
 
     /**
      * Get an element of this <code>Name</code>.

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=410599&r1=410598&r2=410599&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 10:01:12 2006
@@ -66,7 +66,7 @@
      * 
      * @serial
      */
-    protected Vector addrs;
+    protected Vector<RefAddr> addrs;
 
     /**
      * The class in a factory which is used to create an object of the type 
@@ -135,7 +135,7 @@
         this.className = className;
         this.classFactory = classFactory;
         this.classFactoryLocation = classFactoryLocation;
-        this.addrs = new Vector();
+        this.addrs = new Vector<RefAddr>();
     }
 
     /**
@@ -309,7 +309,7 @@
     public Object clone() {
         try {
             Reference r = (Reference) super.clone();
-            r.addrs = (Vector) this.addrs.clone();
+            r.addrs = (Vector<RefAddr>) this.addrs.clone();
             return r;
         } catch (CloneNotSupportedException e) {
             throw new InternalError("Failed to clone object of Reference class."); //$NON-NLS-1$



Mime
View raw message