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

Define Position.NOPOS == Diagnostic.NOPOS

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • 17
    • tools
    • b18

      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.

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

              Created:
              Updated:
              Resolved: