DocTrees.getElement returns a package when none is expected or defined

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 20
    • Component/s: tools
    • None
    • Environment:

      macOS Monterey 12.6 (21G115)

      Consider this example used to test JavaDoc:

          package x;

          public class Parent {

              /** @throws X sometimes */
              public <X extends Throwable> void m() throws X { }
          }
          
          ...
          
          package x;

          public class Child extends Parent {

              /** @throws X {@inheritDoc} */
              @Override
              public void m() { }
          }

      When asked for an element corresponding to a doc path pointing at `X` in "@throws X sometimes", the DocTrees.getElement methods returns a package element with the name `X`.

      If either the package `x` or the "type parameter" `X` gets renamed to a unique identifier, that method returns `null` as one would expect it to.

      Since this bug can only be reproduced on macOS, I have a suspicion that it's due to the filesystem (APFS) being case-insensitive and/or case-preserving.

      On Linux and Windows DocTrees.getElement for the above case returns null.

            Assignee:
            Unassigned
            Reporter:
            Pavel Rappo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: