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.
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.
- relates to
-
JDK-8295753 (fs) UnixPath::toRealPath does not return correct case when links not followed
-
- Resolved
-