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

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

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: