|
|
Author: akarasulu
Date: Thu Aug 11 22:25:08 2005
New Revision: 232209
URL: http://svn.apache.org/viewcvs?rev=232209&view=rev
Log:
fixing places that did not properly use Attributes.put()
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java
URL:
http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java?rev=232209&r1=232208&r2=232209&view=diff
==============================================================================
---
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java
(original)
+++
directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/partition/impl/btree/jdbm/JdbmContextPartition.java
Thu Aug 11 22:25:08 2005
@@ -954,7 +954,7 @@
public Attributes getIndices( BigInteger id ) throws NamingException
{
- Attributes attributes = new LockableAttributesImpl();
+ LockableAttributesImpl attributes = new LockableAttributesImpl();
// Get the distinguishedName to id mapping
attributes.put( "_nDn", getEntryDn( id ) );
@@ -971,7 +971,14 @@
{
IndexRecord rec = ( IndexRecord ) list.next();
Object val = rec.getIndexKey();
- attributes.put( index.getAttribute().getName(), val );
+ String attrId = index.getAttribute().getName();
+ Attribute attr = attributes.get( attrId );
+ if ( attr == null)
+ {
+ attr = new LockableAttributeImpl( attributes, attrId );
+ }
+ attr.add( val );
+ attributes.put( attr );
}
}
@@ -985,17 +992,27 @@
val.append( "_existance[" );
val.append( rec.getIndexKey() );
val.append( "]" );
- attributes.put( val.toString(), rec.getEntryId() );
+
+ String valStr = val.toString();
+ Attribute attr = attributes.get( valStr );
+ if ( attr == null )
+ {
+ attr = new LockableAttributeImpl( attributes, valStr );
+ }
+ attr.add( rec.getEntryId() );
+ attributes.put( attr );
val.setLength( 0 );
}
// Get all parent child mappings for this entry as the parent using the
// key 'child' with many entries following it.
list = hierarchyIdx.listIndices( id );
- while ( list.hasMore() )
+ Attribute childAttr = new LockableAttributeImpl( attributes, "_child"
);
+ attributes.put( childAttr );
+ while ( list.hasMore() )
{
IndexRecord rec = ( IndexRecord ) list.next();
- attributes.put( "_child", rec.getEntryId() );
+ childAttr.add( rec.getEntryId() );
}
return attributes;
@@ -1275,8 +1292,14 @@
* Also we make sure that the existance index shows the existance of
the
* new Rdn attribute within this entry.
*/
-
- entry.put( newRdnAttr, newRdnValue );
+
+ Attribute rdnAttr = entry.get( newRdnAttr );
+ if ( rdnAttr == null )
+ {
+ rdnAttr = new LockableAttributeImpl( newRdnAttr );
+ }
+ rdnAttr.add( newRdnValue );
+ entry.put( rdnAttr );
if ( hasUserIndexOn( newRdnAttr ) )
{
|
|