Harmony
  1. Harmony
  2. HARMONY-123

Refactor: java.nio.charset.CharsetDecoder.decode

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      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.

        Activity

        Hide
        Richard Liang added a comment -

        Here is my update. Would you please take a try? Thanks a lot.

        Show
        Richard Liang added a comment - Here is my update. Would you please take a try? Thanks a lot.
        Hide
        Tim Ellison added a comment -

        Richard,

        Thanks for the patch, it has been applied to NIO_CHAR java.nio.charset.CharsetDecoder at repo revision 380121.

        Please check that the patch was applied as you expected.

        Show
        Tim Ellison added a comment - Richard, Thanks for the patch, it has been applied to NIO_CHAR java.nio.charset.CharsetDecoder at repo revision 380121. Please check that the patch was applied as you expected.
        Hide
        Richard Liang added a comment -

        Tim,
        The fix is good. Please close this JIRA. Thanks a lot.

        Show
        Richard Liang added a comment - Tim, The fix is good. Please close this JIRA. Thanks a lot.
        Hide
        Tim Ellison added a comment -

        Verified by Richard

        Show
        Tim Ellison added a comment - Verified by Richard

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Richard Liang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development