src/share/classes/javax/naming/InitialContext.java
Print this page
*** 230,243 ****
* @throws NamingException if a naming exception is encountered
*
* @see #InitialContext(boolean)
* @since 1.3
*/
protected void init(Hashtable<?,?> environment)
throws NamingException
{
! myProps = ResourceManager.getInitialEnvironment(environment);
if (myProps.get(Context.INITIAL_CONTEXT_FACTORY) != null) {
// user has specified initial context factory; try to get it
getDefaultInitCtx();
}
--- 230,245 ----
* @throws NamingException if a naming exception is encountered
*
* @see #InitialContext(boolean)
* @since 1.3
*/
+ @SuppressWarnings("unchecked")
protected void init(Hashtable<?,?> environment)
throws NamingException
{
! 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
getDefaultInitCtx();
}
*** 263,272 ****
--- 265,275 ----
*
* @see #doLookup(String)
* @see #lookup(Name)
* @since 1.6
*/
+ @SuppressWarnings("unchecked")
public static <T> T doLookup(Name name)
throws NamingException {
return (T) (new InitialContext()).lookup(name);
}
*** 277,286 ****
--- 280,290 ----
* the name of the object to look up
* @return the object bound to <tt>name</tt>
* @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);
}