--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java Thu Nov 22 11:15:53 2018 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java Thu Nov 22 15:38:20 2018 +0100
@@ -882,12 +882,15 @@
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitReference(ReferenceTree tree, Void ignore) {
String sig = tree.getSignature();
- if (sig.contains("<") || sig.contains(">"))
+ if (sig.contains("<") || sig.contains(">")) {
env.messages.error(REFERENCE, tree, "dc.type.arg.not.allowed");
-
- Element e = env.trees.getElement(getCurrentPath());
- if (e == null)
- env.messages.error(REFERENCE, tree, "dc.ref.not.found");
+ } else if (isArrayType(sig)) {
+ env.messages.error(REFERENCE, tree, "dc.array.type.not.allowed");
+ } else {
+ Element e = env.trees.getElement(getCurrentPath());
+ if (e == null)
+ env.messages.error(REFERENCE, tree, "dc.ref.not.found");
+ }
return super.visitReference(tree, ignore);
}
@@ -972,6 +975,12 @@
return scan(tree.getDescription(), ignore);
}
+ private boolean isArrayType(String signature) {
+ int brackets = signature.indexOf('[');
+ int parens = signature.indexOf('(');
+ return brackets >= 0 && (parens < 0 || brackets < parens);
+ }
+
private boolean isThrowable(TypeMirror tm) {
switch (tm.getKind()) {
case DECLARED: