String principal; String credential; String authentication; String providerUrl;  env = ( Hashtable ) env.clone();   Object value = env.remove( Context.SECURITY_PRINCIPAL ); if( value == null ) { principal = null; } else { principal = value.toString(); }  value = env.remove( Context.SECURITY_CREDENTIALS ); if( value == null ) { credential = null; } else { credential = value.toString(); }  value = env.remove( Context.SECURITY_AUTHENTICATION ); if( value == null ) { authentication = "none"; } else { authentication = value.toString(); }  value = env.remove( Context.PROVIDER_URL ); if( value == null ) { value = ""; } providerUrl = value.toString();
String principal = extractPrincipal( env ); byte[] credential = extractCredential( env ); String authentication = extractAuthentication( env ); String providerUrl = extractProviderUrl( env );
    public final synchronized Context getInitialContext( Hashtable env ) throws NamingException    {        Configuration cfg = Configuration.toConfiguration( env );                String principal;        String credential;        String authentication;        String providerUrl;        env = ( Hashtable ) env.clone();        // Remove properties that can be changed        Object value = env.remove( Context.SECURITY_PRINCIPAL );        if( value == null )        {            principal = null;        }        else        {            principal = value.toString();        }                value = env.remove( Context.SECURITY_CREDENTIALS );        if( value == null )        {            credential = null;        }        else        {            credential = value.toString();        }                value = env.remove( Context.SECURITY_AUTHENTICATION );        if( value == null )        {            authentication = "none";        }        else        {            authentication = value.toString();        }        value = env.remove( Context.PROVIDER_URL );        if( value == null )        {            value = "";        }        providerUrl = value.toString();        // Execute configuration        if( cfg instanceof ShutdownConfiguration )        {            provider.shutdown();        }        else if( cfg instanceof SyncConfiguration )        {            provider.sync();        }        else if( cfg instanceof StartupConfiguration )        {            ( ( DefaultContextFactoryContext ) provider ).startup( this, env );        }        else        {            throw new NamingException( "Unknown configuration: " + cfg );        }                return provider.getJndiContext( principal, credential, authentication, providerUrl );    }