} else if ( attrIdsHasPlus && attrIdsHasStar ) { entry = ( Attributes ) rec.getAttributes().clone(); } else if ( attrIdsHasPlus ) { entry = new LockableAttributesImpl();   for ( int ii = 0; ii < attrIds.length; ii++ ) { if ( attrIds[ii].equals( "+") ) { continue; }  if ( null == rec.getAttributes().get( attrIds[ii] ) ) { continue; }   Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone(); entry.put( attr ); }   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();   for ( int ii = 0; ii < attrIds.length; ii++ ) { if ( attrIds[ii].equals( "*") ) { continue; }  if ( null == rec.getAttributes().get( attrIds[ii] ) ) { continue; }   Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone(); entry.put( attr ); }   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 ); } }
    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        {            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 );    }