Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-3032

throwIfIA5IllegalCharacter does not check the first character

    XMLWordPrintable

    Details

      Description

      This looks like a copy/paste error from another method in SchemaUtils. The comment is not right either:

          private static void throwIfIA5IllegalCharacter(StringBuilder buffer, ByteSequence value) throws DecodeException {
              // Replace any consecutive spaces with a single space and watch out
              // for non-ASCII characters.
              for (int pos = buffer.length() - 1; pos > 0; pos--) {
                  final char c = buffer.charAt(pos);
                  if ((c & 0x7F) != c) {
                      // This is not a valid character for an IA5 string. If strict
                      // syntax enforcement is enabled, then we'll throw an exception.
                      // Otherwise, we'll get rid of the character.
                      throw DecodeException.error(
                              WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(value, c));
                  }
              }
          }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ian.packer Ian Packer [X] (Inactive)
              Reporter:
              ian.packer Ian Packer [X] (Inactive)
              Dev Assignee:
              Ian Packer [X] Ian Packer [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: