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

Jean-Noël Rouvignac
03.14.2016 959f728f4cc9d1b0e09ae7b99abf2457ac43e807
OPENDJ-3205 Control-panel: fix java-settings

Restore code behaviour prior to commit d82f97fc80525
2 files modified
28 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/LDAPEntryTableCellRenderer.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java 24 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/LDAPEntryTableCellRenderer.java
@@ -28,7 +28,6 @@
import javax.swing.JLabel;
import javax.swing.JTable;
import org.forgerock.opendj.ldap.AttributeDescription;
import org.opends.guitools.controlpanel.browser.IconPool;
import org.opends.guitools.controlpanel.datamodel.BinaryValue;
import org.opends.guitools.controlpanel.datamodel.ObjectClassValue;
@@ -235,8 +234,7 @@
    if (col == 0)
    {
      Object o = table.getValueAt(row, 0);
      return requiredAttrs.contains(
          AttributeDescription.valueOf((String)o).getNameOrOID().toLowerCase());
      return requiredAttrs.contains(Utilities.getAttributeNameWithoutOptions((String) o).toLowerCase());
    }
    return false;
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
@@ -1467,6 +1467,28 @@
  }
  /**
   * Returns the attribute name with no options (or subtypes).
   * <p>
   * Note: normal code should use <code>AttributeDescription.valueOf(attrName).getNameOrOID()</code>
   * <p>
   * However this method is used by UI code which sometimes receives strings which are not valid
   * attribute descriptions.
   *
   * @param attrDesc
   *          the complete attribute name.
   * @return the attribute name with no options (or subtypes).
   */
  public static String getAttributeNameWithoutOptions(String attrDesc)
  {
    int index = attrDesc.indexOf(";");
    if (index != -1)
    {
      return attrDesc.substring(0, index);
    }
    return attrDesc;
  }
  /**
   * Strings any potential "separator" from a given string.
   * @param s string to strip
   * @param separator  the separator string to remove
@@ -1474,7 +1496,7 @@
   */
  private static String stripStringToSingleLine(String s, String separator)
  {
    return (s == null) ? null : s.replaceAll(separator, "");
    return (s != null) ? s.replaceAll(separator, "") : null;
  }
  /** The pattern for control characters. */