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

(cs) Charset{De,En}coder should expose state to subclasses

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description



      Name: nt126004 Date: 03/03/2003


      A DESCRIPTION OF THE REQUEST :
      Both of these classes require subclassing to create a new encoder or decoder, respectively. Both of these classes also maintain an internal state of RESET, CODING, CODING_END, or FLUSHED.
      Subclassing either one of these classes can be difficult, however, because the internal state maintained by these classes is opaque (no getters or setters, period) to the subclass. Additionally, all external methods that change this state are declared as final, making it impossible to create a similar state in the subclass. This is especially problematic when the subclass is an aggregating encoder/decoder liek the type require to do generic ISO-2022 encoding and decoding.

      JUSTIFICATION :
        To allow easier subclassing of these classes as is intended by the java.nio.charset framework.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I would expect to be able to at least monitor the state via a protected or public getter. A protected setter to allow subclasses to change the state would also be expected. Leaving the current final methods final is probably acceptable.
      See description above.
      (Review ID: 181968)
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            sherman Xueming Shen
            Reporter:
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: