Proper LDIF backend for deploy configs.
[lgpl/argeo-commons.git] / org.argeo.security.core / src / org / argeo / util / naming / AttributesDictionary.java
index a6fddb440804801f81eb01b3ca05283f6099cfd9..73099ef4e414d83ecdefd364e91b11f96902ac8c 100644 (file)
@@ -118,9 +118,12 @@ public class AttributesDictionary extends Dictionary<String, Object> {
                                attr.set(i, values[i]);
                        }
                } else {
-                       if (attr.size() != 1)
+                       if (attr.size() > 1)
                                throw new IllegalArgumentException("Attribute " + key + " is multi-valued");
-                       attr.set(0, value.toString());
+                       if (attr.size() == 1)
+                               attr.set(0, value.toString());
+                       else
+                               attr.add(value.toString());
                }
                return oldValue;
        }