mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Chris Ridd
22.13.2014 c51e868e27ab66bd7d0950d390f28c4c65d0abba
OPENDJ-1574 CR-4564: Allow editing of single-valued InetAddress properties
1 files modified
13 ■■■■■ changed files
opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java 13 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/PropertyValueEditor.java
@@ -1969,10 +1969,15 @@
      if (result.isSuccess()) {
        // Set the new property value(s).
        Collection<T> newValues = result.getValues();
        Collection<T> values = result.getValues();
        // Both newValues and oldValues sets need to use the PropertyDefinition
        // as their comparator. Constructing a TreeSet<T> directly with the
        // values collection will fail if the values are e.g. InetAddresses.
        SortedSet<T> newValues = new TreeSet<T>(d);
        newValues.addAll(values);
        SortedSet<T> oldValues = new TreeSet<T>(mo.getPropertyValues(d));
        mo.setPropertyValues(d, newValues);
        if (newValues.size() > 0)
        mo.setPropertyValues(d, values);
        if (values.size() > 0)
        {
          isLastChoiceReset = false;
        }
@@ -1981,7 +1986,7 @@
          // There are no newValues when we do a reset.
          isLastChoiceReset = true;
        }
        registerModification(d, new TreeSet<T>(newValues), oldValues);
        registerModification(d, newValues, oldValues);
        app.println();
        app.pressReturnToContinue();
        return MenuResult.success(false);