directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r478123 - /directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/AttributeAddWizardPage.java
Date Wed, 22 Nov 2006 10:57:27 GMT
Author: pamarcelot
Date: Wed Nov 22 02:57:23 2006
New Revision: 478123

URL: http://svn.apache.org/viewvc?view=rev&rev=478123
Log:
Fixing a bug. Adding a new attribute with an already existing attribute name caused the older
values to vanish, letting the attribute with only the new value.

Modified:
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/AttributeAddWizardPage.java

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/AttributeAddWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/AttributeAddWizardPage.java?view=diff&rev=478123&r1=478122&r2=478123
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/AttributeAddWizardPage.java
(original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/AttributeAddWizardPage.java
Wed Nov 22 02:57:23 2006
@@ -23,6 +23,7 @@
 
 import java.io.File;
 
+import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.ldapstudio.browser.Activator;
@@ -326,8 +327,15 @@
                 {
                     // Adding the provided attribute value
                     Attributes attributes = entry.getPartialAttributeList();
-
-                    attributes.put( nameText.getText(), textText.getText() );
+                    Attribute attribute = attributes.get( nameText.getText() );
+                    if ( attribute == null )
+                    {
+                        attributes.put( nameText.getText(), textText.getText() );
+                    }
+                    else
+                    {
+                        attribute.add( textText.getText() );
+                    }
 
                     // refreshing the UI
                     AttributesView attributesView = ( AttributesView ) PlatformUI.getWorkbench()



Mime
View raw message