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

(cs) Charset-X-Coder.flush cannot be reinvoked in case of overflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 5.0, 6
    • core-libs
    • None
    • b53
    • generic
    • generic

      The spec for CharsetEncoder.flush states

      If this method completes successfully then it returns CoderResult.UNDERFLOW. If there is insufficient room in the output buffer then it returns CoderResult.OVERFLOW. If this happens then this method must be invoked again, with an output buffer that has more room, in order to complete the current encoding operation.

      However, the implementation unconditionally throws an IllegalStateException
      if flush is invoked twice, even if it returned UNDERFLOW the first time.
      This happens with any encoder or decoder with a non-trivial flush method.

      Exception in thread "main" java.lang.IllegalStateException: Current state = FLUSHED, new state = FLUSHED

      ###@###.### 2005-2-10 02:34:26 GMT

            martin Martin Buchholz
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: