DefaultStyledDocument.setCharacterAttributes accepts negative length

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 20
    • Affects Version/s: 11, 17, 19, 20
    • Component/s: client-libs
    • b13
    • generic
    • generic

      DefaultStyledDocument.setCharacterAttributes() takes in length parameter which as per spec
      length - the length >= 0

      but in implementation, it only checks for
      if (length == 0) {
                  return;
              }

      It should be length < 0 as text length cannot be -ve.
      Also, need to check if length = 0 is valid or not.

            Assignee:
            Tejesh R
            Reporter:
            Prasanta Sadhukhan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: