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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 6
    • Affects Version/s: 5.0, 6
    • Component/s: 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: