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

Enforce best practices for Node token API usage

    Details

    • Type: Task
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b64
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Nashorn's Node class has both a "TokenType tokenType()" method and a "boolean isTokenType(TokenType)" method, and often we can see expressions of form "node.tokenType() == <tokenType>" that could be consistently replaced with "node.isTokenType(<tokenType>).

        There's also some weird roundabout usage of "Token.descType(node.getToken())" in places which should simply by "node.tokenType()".

        No big deal, but API usage consistency is nice to have for clarity.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  attila Attila Szegedi
                  Reporter:
                  attila Attila Szegedi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: