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

Define Position.NOPOS == Diagnostic.NOPOS

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 18
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b18

      Description

      In javac, we should define the (internal) value Position.NOPOS to have the same value as the (external) public value Diagnostic.NOPOS.

      The values are conceptually the same; the code in JCTree uses Position.NOPOS, and tree positions are routinely used in diagnostics. The public Diagnostic.NOPOS was introduced in JSR199 to define the sentinel value, and Position.NOPOS was/is in an internal API that should not be exposed directly. The difference in type (the public value is `long`, the internal value is just `int`) is because of the general policy in `javax.tools` to support alternate tool implementations that might support huge files, even though javac itself only supports `int`-sized files.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jjg Jonathan Gibbons
              Reporter:
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: