return new BTreeSearchResult( rec.getEntryId(), name, null, entry );
BTreeSearchResult result = new BTreeSearchResult( rec.getEntryId(), name, null, entry ); result.setRelative( false ); return result;
    public Object next() throws NamingException    {        IndexRecord rec = ( IndexRecord ) underlying.next();        Attributes entry;        String name = partition.getEntryUpdn( rec.getEntryId() );        if ( null == rec.getAttributes() )        {            rec.setAttributes( partition.lookup( rec.getEntryId() ) );        }        if ( attrIds == null )        {            entry = ( Attributes ) rec.getAttributes().clone();        }        else if ( attrIdsHasPlus && attrIdsHasStar )        {            entry = ( Attributes ) rec.getAttributes().clone();        }        else if ( attrIdsHasPlus )        {            entry = new LockableAttributesImpl();            // add all listed attributes            for ( int ii = 0; ii < attrIds.length; ii++ )            {                if ( attrIds[ii].equals( "+" ) )                {                    continue;                }                // there is no attribute by that name in the entry so we continue                if ( null == rec.getAttributes().get( attrIds[ii] ) )                {                    continue;                }                // clone attribute to stuff into the new resultant entry                Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone();                entry.put( attr );            }            // add all operational attributes            NamingEnumeration list = rec.getAttributes().getIDs();            while ( list.hasMore() )            {                String attrId = ( String ) list.next();                AttributeType attrType = registry.lookup( attrId );                if ( attrType.getUsage() == UsageEnum.USERAPPLICATIONS )                {                    continue;                }                Attribute attr = ( Attribute ) rec.getAttributes().get( attrId ).clone();                entry.put( attr );            }        }        else if ( attrIdsHasStar )        {            entry = new LockableAttributesImpl();            // add all listed operational attributes            for ( int ii = 0; ii < attrIds.length; ii++ )            {                if ( attrIds[ii].equals( "*" ) )                {                    continue;                }                // there is no attribute by that name in the entry so we continue                if ( null == rec.getAttributes().get( attrIds[ii] ) )                {                    continue;                }                // clone attribute to stuff into the new resultant entry                Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone();                entry.put( attr );            }            // add all user attributes            NamingEnumeration list = rec.getAttributes().getIDs();            while ( list.hasMore() )            {                String attrId = ( String ) list.next();                AttributeType attrType = registry.lookup( attrId );                if ( attrType.getUsage() == UsageEnum.USERAPPLICATIONS )                {                    Attribute attr = ( Attribute ) rec.getAttributes().get( attrId ).clone();                    entry.put( attr );                }            }        }        else        {            entry = new LockableAttributesImpl();            for ( int ii = 0; ii < attrIds.length; ii++ )            {                // there is no attribute by that name in the entry so we continue                if ( null == rec.getAttributes().get( attrIds[ii] ) )                {                    continue;                }                // clone attribute to stuff into the new resultant entry                Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone();                entry.put( attr );            }        }        return new BTreeSearchResult( rec.getEntryId(), name, null, entry );    }