portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jf...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/common/impl GenericMetadataImpl.java
Date Mon, 08 Mar 2004 16:34:53 GMT
jford       2004/03/08 08:34:53

  Modified:    components/registry/src/java/org/apache/jetspeed/om/common/impl
                        GenericMetadataImpl.java
  Log:
  Make sure to remove all values from the collection
  
  Revision  Changes    Path
  1.4       +14 -2     jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/common/impl/GenericMetadataImpl.java
  
  Index: GenericMetadataImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/common/impl/GenericMetadataImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GenericMetadataImpl.java	8 Mar 2004 15:59:47 -0000	1.3
  +++ GenericMetadataImpl.java	8 Mar 2004 16:34:52 -0000	1.4
  @@ -84,6 +84,17 @@
       public void setFields(String name, Collection values)
       {
           fieldMap.remove(name);
  +        
  +        Iterator fieldIter = fields.iterator();
  +        while(fieldIter.hasNext())
  +        {
  +            LocalizedField field = (LocalizedField)fieldIter.next();
  +            if(field != null && field.getName() != null && field.getName().equals(name))
  +            {
  +                fieldIter.remove();
  +            }
  +        }
  +        
           if(values != null)
           {    
               Iterator iter = values.iterator();
  @@ -92,7 +103,8 @@
                   LocalizedField field = (LocalizedField)iter.next();
                   fieldMap.put(field.getName(), field);
               }
  -            fields.removeAll(values);
  +            
  +            fields.addAll(values);
           }
       }
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message