jdk/src/share/classes/javax/naming/InitialContext.java
changeset 10324 e28265130e4f
parent 5506 202f599c92aa
child 18580 6c4badf4ffba
--- a/jdk/src/share/classes/javax/naming/InitialContext.java	Wed Aug 10 16:23:56 2011 -0400
+++ b/jdk/src/share/classes/javax/naming/InitialContext.java	Wed Aug 10 13:44:58 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -232,10 +232,12 @@
      * @see #InitialContext(boolean)
      * @since 1.3
      */
+    @SuppressWarnings("unchecked")
     protected void init(Hashtable<?,?> environment)
         throws NamingException
     {
-        myProps = ResourceManager.getInitialEnvironment(environment);
+        myProps = (Hashtable<Object,Object>)
+                ResourceManager.getInitialEnvironment(environment);
 
         if (myProps.get(Context.INITIAL_CONTEXT_FACTORY) != null) {
             // user has specified initial context factory; try to get it
@@ -265,6 +267,7 @@
      * @see #lookup(Name)
      * @since 1.6
      */
+    @SuppressWarnings("unchecked")
     public static <T> T doLookup(Name name)
         throws NamingException {
         return (T) (new InitialContext()).lookup(name);
@@ -279,6 +282,7 @@
      * @throws  NamingException if a naming exception is encountered
       * @since 1.6
      */
+    @SuppressWarnings("unchecked")
     public static <T> T doLookup(String name)
         throws NamingException {
         return (T) (new InitialContext()).lookup(name);