Attributes attrs = getRootDSE();
Attributes attrs = ( Attributes ) getRootDSE().clone();  String[] ids = searchCtls.getReturningAttributes(); if ( ids != null && ids.length > 0 ) { boolean doSwap = true; Attributes askedFor = new LockableAttributesImpl();  for ( int ii = 0; ii < ids.length; ii++ ) { if ( ids[ii].trim().equals( "*" ) ) { doSwap = false; break; }  if ( attrs.get( ids[ii] ) != null ) { askedFor.put( attrs.get( ids[ii] ) ); } }  if ( doSwap ) { attrs = askedFor; } }
    public NamingEnumeration search( Name base, Map env, ExprNode filter,                                     SearchControls searchCtls )        throws NamingException    {        if ( base.size() == 0 )        {            /*             * if basedn is "", filter is "(objectclass=*)" and scope is object             * then we have a request for the rootDSE             */            if ( filter instanceof PresenceNode &&                 searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE &&                 ( ( PresenceNode ) filter ).getAttribute().equalsIgnoreCase( "objectclass" ) )            {                Attributes attrs = getRootDSE();                SearchResult result = new SearchResult( "", null, attrs, false );                return new SingletonEnumeration( result );            }            throw new LdapNameNotFoundException();        }        ContextPartition backend = getBackend( base );        return backend.search( base, env, filter, searchCtls );    }