src/share/classes/javax/naming/spi/DirectoryManager.java

Print this page

        

@@ -82,19 +82,20 @@
       * @return A non-null <tt>DirContext</tt> object for continuing the operation.
       * @exception NamingException If a naming exception occurred.
       *
       * @see NamingManager#getContinuationContext(CannotProceedException)
       */
+    @SuppressWarnings("unchecked")
     public static DirContext getContinuationDirContext(
             CannotProceedException cpe) throws NamingException {
 
-        Hashtable env = cpe.getEnvironment();
+        Hashtable<Object,Object> env = (Hashtable<Object,Object>)cpe.getEnvironment();
         if (env == null) {
-            env = new Hashtable(7);
+            env = new Hashtable<>(7);
         } else {
             // Make a (shallow) copy of the environment.
-            env = (Hashtable) env.clone();
+            env = (Hashtable<Object,Object>) env.clone();
         }
         env.put(CPE, cpe);
 
         return (new ContinuationDirContext(cpe, env));
     }

@@ -215,11 +216,11 @@
                                                environment, attrs);
             return (answer != null) ? answer : refInfo;
     }
 
     private static Object createObjectFromFactories(Object obj, Name name,
-            Context nameCtx, Hashtable environment, Attributes attrs)
+            Context nameCtx, Hashtable<?,?> environment, Attributes attrs)
         throws Exception {
 
         FactoryEnumeration factories = ResourceManager.getFactories(
             Context.OBJECT_FACTORIES, environment, nameCtx);