src/share/classes/com/sun/jndi/cosnaming/CNNameParser.java

Print this page

        

@@ -65,11 +65,11 @@
     * Returns a CompoundName given a string in INS syntax.
     * @param name The non-null string representation of the name.
     * @return a non-null CompoundName
     */
     public Name parse(String name) throws NamingException {
-        Vector comps = insStringToStringifiedComps(name);
+        Vector<String> comps = insStringToStringifiedComps(name);
         return new CNCompoundName(comps.elements());
     }
 
     /**
      * Creates a NameComponent[] from a Name structure.

@@ -126,15 +126,15 @@
     /**
      * Converts an INS-syntax string name into a Vector in which
      * each element of the vector contains a stringified form of
      * a NameComponent.
      */
-    private static Vector insStringToStringifiedComps(String str)
+    private static Vector<String> insStringToStringifiedComps(String str)
         throws InvalidNameException {
 
         int len = str.length();
-        Vector components = new Vector(10);
+        Vector<String> components = new Vector<>(10);
         char[] id = new char[len];
         char[] kind = new char[len];
         int idCount, kindCount;
         boolean idMode;
         for (int i = 0; i < len; ) {

@@ -304,25 +304,25 @@
     /**
      * An implementation of CompoundName that bypasses the parsing
      * and stringifying code of the default CompoundName.
      */
     static final class CNCompoundName extends CompoundName {
-        CNCompoundName(Enumeration enum_) {
+        CNCompoundName(Enumeration<String> enum_) {
             super(enum_, CNNameParser.mySyntax);
         }
 
         public Object clone() {
             return new CNCompoundName(getAll());
         }
 
         public Name getPrefix(int posn) {
-            Enumeration comps = super.getPrefix(posn).getAll();
+            Enumeration<String> comps = super.getPrefix(posn).getAll();
             return new CNCompoundName(comps);
         }
 
         public Name getSuffix(int posn) {
-            Enumeration comps = super.getSuffix(posn).getAll();
+            Enumeration<String> comps = super.getSuffix(posn).getAll();
             return new CNCompoundName(comps);
         }
 
         public String toString() {
             try {