On Wed, 5 May 2021 06:39:14 GMT, Hannes Wallnöfer <[email protected]> wrote:
> `DocCommentParser#reference` only accepts whitespace within matching `()` or
> `<>`. A whitespace character before the parentheses as shown above will
> result in `java.net.URL#URL` being considered the reference and the part in
> parentheses being considered the label.
You are absolutely right. I got immersed in CommentHelper.normalizeSignature so
much so that I forgot about separating function of whitespace in positional
argument parsing.
> Yes, it can. This is covered by
> test/langtools/jdk/javadoc/doclet/testTagMisuse/TestTagMisuse.java
I think it's an empty string that ReferenceTree.getSignature can return, not
null. To check that, I modified DCReference as follows and ran the tests
(including TestTagMisuse), which all passed:
DCReference(String signature, JCTree.JCExpression moduleName, JCTree
qualExpr, Name member, List<JCTree> paramTypes) {
- this.signature = signature;
+ this.signature = Objects.requireNonNull(signature);
-------------
PR: https://git.openjdk.java.net/jdk/pull/3754