Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-123

Refactor: java.nio.charset.CharsetDecoder.decode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None

    Description

      I've refactored two decode methods in CharsetDecode.java. Although the original version runs well, the structure of these two methods is messed. The refactored methods include:
      1. public final CharBuffer decode(ByteBuffer in) throws CharacterCodingException;
      2. public final CoderResult decode(ByteBuffer in, CharBuffer out,boolean endOfInput);

      Main changes:
      1. remove embedded "while" in decode(ByteBuffer in, CharBuffer out,boolean endOfInput);
      2. restruct condition control process in both two methods.
      3. truncate return value of decode(in), which means the returned CharBuffer has the same value between capacity and limit.

      Attachments

        1. CharsetDecoder_patch.txt
          7 kB
          Richard Liang

        Activity

          People

            tellison Tim Ellison
            richard_liang Richard Liang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: