RFR: JDK-8273244: Improve diagnostic output related to ErroneousTree [v5]

Jonathan Gibbons jjg at openjdk.java.net
Fri Oct 1 15:44:38 UTC 2021


On Fri, 1 Oct 2021 10:25:41 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   improve comments in new tests
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java line 225:
> 
>> 223:         }
>> 224: 
>> 225:         return Position.NOPOS;
> 
> This method should return Diagnostic.NOPOS.
> 
> I'm concerned with mixing com.sun.tools.javac.util.Position.NOPOS and javax.tools.Diagnostic.NOPOS. Although they currently have the same int value, they are of different types, used in different contexts, and not guaranteed to remain equal in the future. We might need to do something about it.

Hmmm. I doubt this is the only place where the values are conflated.  I'll check with other `javac` folk about defining `com.sun.tools.javac.util.Position.NOPOS` in terms of `javax.tools.Diagnostic.NOPOS`.   The internal version predates the public value, but the two are intended too be the same.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5510


More information about the javadoc-dev mailing list