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

matthew_swift
22.33.2007 e6e55855e28f061ad6662ac45373e56e6770307d
Fix issue 2286: class properties would allow empty class names.

This change modifies the class property definition implementation so that it now prevents empty class names.
2 files modified
6 ■■■■■ changed files
opends/src/server/org/opends/server/admin/ClassPropertyDefinition.java 3 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/ClassPropertyDefinitionTest.java 3 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/admin/ClassPropertyDefinition.java
@@ -131,8 +131,7 @@
  // Regular expression for validating class names.
  private static final String CLASS_RE =
    "^([A-Za-z]+[A-Za-z0-9_]*)*(\\.[A-Za-z]+[A-Za-z0-9_]*)"
      + "*([\\$][A-Za-z0-9_]+)*$";
    "^([A-Za-z][A-Za-z0-9_]*\\.)*[A-Za-z][A-Za-z0-9_]*(\\$[A-Za-z0-9_]+)*$";
  // Flag indicating whether class property values should be
  // validated.
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/ClassPropertyDefinitionTest.java
@@ -93,6 +93,9 @@
  public Object[][] createBuilderAddInstanceOfData2() {
    return new Object[][]{
            { "1" },
            { "" },
            { " " },
            { "  " },
            { "abc." },
            { "abc.123" },
            { "abc.123$" },