change some private members to protected in com.sun.tools.javac.parser.Scanner

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Rejected
    • Priority: P4
    • None
    • Affects Version/s: 7
    • Component/s: tools
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      In doing some research with the OpenJDK javac compiler, I need to extend the Scanner and Parser to scan and parse text in comments that is Java-like but has some additional syntax. It would be very helpful to be able to extend the Scanner class to create the modified Scanner (and then the registry mechanism to use it). The derived class however needs access to a number of fields in Scanner, which could be changed from private to protected:

      buf, ch, scanIdent, scanOperator, scanChar, isSpecial, lexError


      JUSTIFICATION :
      This feature will improve the ability to extend and research the Javac compiler. The workaround of duplicating the class and modifying directly just to get access to private fields is bad design.


      CUSTOMER SUBMITTED WORKAROUND :
        Duplicate code and modify in place - which is bad for maintenance as the base source code changes.

            Assignee:
            Unassigned
            Reporter:
            Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: