On Mon, 27 Sep 2021 18:00:07 GMT, Pavel Rappo <[email protected]> wrote:

> > Apart from fixing generally bad behavior, there is one other tiny 
> > behavioral change. For an empty DocCommentTree the ending position is now 
> > the same at the starting position, and not NOPOS.
> 
> I suppose we don't need to reflect this change anywhere in the API (CSR), do 
> we?

I don't believe the specification is so fine-grained.

> src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java line 174:
> 
>> 172:             case IDENTIFIER -> {
>> 173:                 DCIdentifier ident = (DCIdentifier) this;
>> 174:                 return ident.pos + ident.name.length();
> 
> While in JavacTrees, this logic contained some special handling for 
> `names.error`. What was that about?

`names.error` is used by javac in various error conditions. It has the string  
value `<error>`.  I don't believe it can arise in `DocTree` nodes, so I dropped 
the code.

> src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java line 192:
> 
>> 190:             case ENTITY -> {
>> 191:                 DCEntity endEl = (DCEntity) this;
>> 192:                 return endEl.pos + endEl.name.length() + 2;
> 
> A similar question about `names.error`.

Similar answer.

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

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

Reply via email to