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

matthew_swift
15.45.2007 42b91233077ab593da9ca6ae4e586cfa83b7918b
opends/src/server/org/opends/server/admin/IPAddressPropertyDefinition.java
@@ -141,7 +141,19 @@
  @Override
  public String encodeValue(InetAddress value)
      throws IllegalPropertyValueException {
    return value.getHostName();
    // We should return the host name if it is available, or the IP
    // address if not.
    // Unforunately, there is no InetAddress method for doing this, so
    // we have to resort to hacking at the toString() encoding.
    String s = value.toString();
    int i = s.indexOf('/');
    if (i > 0) {
      // Host address is before the forward slash.
      return s.substring(0, i);
    } else {
      return value.getHostAddress();
    }
  }