Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7199551

(bf) CharBuffer.append(CharSequence) throws BufferOverflowException for read-only buffer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • core-libs
    • b55
    • 8
    • b61
    • generic
    • generic

      CharBuffer.append(CharSequence) throws BufferOverflowException instead of ReadOnlyBufferException on attemt to attempt to put a String into a read-only CharBuffer that has insufficient space. Formally we cannot consider that as conformance bug because the spec does not explicitly state the order of checks. So any of the mentioned exceptions may be thrown in this case. Nevertheless that changes long-standing behavior and introduces some regression.

      That issue caused the following JCK test failure:
      api/java_nio/CharBuffer/index.html#Methods2[appendCharSequence0006]
      The JCK test should also be fixed/relaxed to conform the specification (separate CR is submitted).

            alanb Alan Bateman
            asutchil Arkadiy Sutchilin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: