@Override public Void scan(DocTree docTree, Void unused) { super.scan(docTree, null); // Don't complain about this unknown tag if we already generated a better fix for it. if (fixedTags.contains(docTree)) { return null; } if (!(docTree instanceof DCInlineTag)) { return null; } JavadocTag tag = inlineTag(((DCInlineTag) docTree).getTagName()); if (validTags.contains(tag) || JavadocTag.KNOWN_OTHER_TAGS.contains(tag)) { return null; } String message = String.format("The tag @%s is not allowed on this type of element.", tag.name()); state.reportMatch( buildDescription(diagnosticPosition(getCurrentPath(), state)) .setMessage(message) .addFix(Utils.replace(docTree, "", state)) .build()); return null; } }
@Override public Void scan(DocTree docTree, Void unused) { super.scan(docTree, null); // Don't complain about this unknown tag if we already generated a better fix for it. if (fixedTags.contains(docTree)) { return null; } if (!(docTree instanceof DCBlockTag)) { return null; } JavadocTag tag = blockTag(((DCBlockTag) docTree).getTagName()); if (validTags.contains(tag) || JavadocTag.KNOWN_OTHER_TAGS.contains(tag)) { return null; } String message = String.format("The tag @%s is not allowed on this type of element.", tag.name()); state.reportMatch( buildDescription(diagnosticPosition(getCurrentPath(), state)) .setMessage(message) .addFix(Utils.replace(docTree, "", state)) .build()); return null; } }
@Override public Void scan(DocTree node, Void p) { if ( node != null && positions.getStartPosition(javac.getCompilationUnit(), docComment, node) <= offset && positions.getEndPosition(javac.getCompilationUnit(), docComment, node) >= offset) { return super.scan(node, p); } return null; } @Override public Void visitReference(ReferenceTree node, Void p) {
@Override public Void scan(DocTree node, Void p) { if ( node != null && positions.getStartPosition(javac.getCompilationUnit(), docComment, node) <= offset && positions.getEndPosition(javac.getCompilationUnit(), docComment, node) >= offset) { return super.scan(node, p); } return null; } @Override public Void visitReference(ReferenceTree node, Void p) {
@Override public Void scan(DocTree docTree, Void unused) { super.scan(docTree, null); // Don't complain about this unknown tag if we already generated a better fix for it. if (fixedTags.contains(docTree)) { return null; } String tagName = null; if (docTree instanceof DCBlockTag) { tagName = ((DCBlockTag) docTree).getTagName(); } if (docTree instanceof DCInlineTag) { tagName = ((DCInlineTag) docTree).getTagName(); } if (tagName != null && !validTags.contains(tagName) && !KNOWN_OTHER_TAGS.contains(tagName)) { String message = String.format("The block tag @%s is not allowed on this type of element.", tagName); state.reportMatch( buildDescription(diagnosticPosition(getCurrentPath(), state)) .setMessage(message) .addFix(Utils.replace(docTree, "", state)) .build()); } return null; } }