< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java

Print this page




 837     @Override @DefinedBy(Api.COMPILER_TREE)
 838     public Void visitLiteral(LiteralTree tree, Void ignore) {
 839         markEnclosingTag(Flag.HAS_INLINE_TAG);
 840         if (tree.getKind() == DocTree.Kind.CODE) {
 841             for (TagStackItem tsi: tagStack) {
 842                 if (tsi.tag == HtmlTag.CODE) {
 843                     env.messages.warning(HTML, tree, "dc.tag.code.within.code");
 844                     break;
 845                 }
 846             }
 847         }
 848         return super.visitLiteral(tree, ignore);
 849     }
 850 
 851     @Override @DefinedBy(Api.COMPILER_TREE)
 852     @SuppressWarnings("fallthrough")
 853     public Void visitParam(ParamTree tree, Void ignore) {
 854         boolean typaram = tree.isTypeParameter();
 855         IdentifierTree nameTree = tree.getName();
 856         Element paramElement = nameTree != null ? env.trees.getElement(new DocTreePath(getCurrentPath(), nameTree)) : null;
 857 
 858         if (paramElement == null) {
 859             switch (env.currElement.getKind()) {
 860                 case CLASS: case INTERFACE: {
 861                     if (!typaram) {
 862                         env.messages.error(REFERENCE, tree, "dc.invalid.param");
 863                         break;
 864                     }
 865                 }
 866                 case METHOD: case CONSTRUCTOR: {
 867                     env.messages.error(REFERENCE, nameTree, "dc.param.name.not.found");
 868                     break;
 869                 }
 870 
 871                 default:
 872                     env.messages.error(REFERENCE, tree, "dc.invalid.param");
 873                     break;
 874             }
 875         } else {
 876             boolean unique = foundParams.add(paramElement);
 877 




 837     @Override @DefinedBy(Api.COMPILER_TREE)
 838     public Void visitLiteral(LiteralTree tree, Void ignore) {
 839         markEnclosingTag(Flag.HAS_INLINE_TAG);
 840         if (tree.getKind() == DocTree.Kind.CODE) {
 841             for (TagStackItem tsi: tagStack) {
 842                 if (tsi.tag == HtmlTag.CODE) {
 843                     env.messages.warning(HTML, tree, "dc.tag.code.within.code");
 844                     break;
 845                 }
 846             }
 847         }
 848         return super.visitLiteral(tree, ignore);
 849     }
 850 
 851     @Override @DefinedBy(Api.COMPILER_TREE)
 852     @SuppressWarnings("fallthrough")
 853     public Void visitParam(ParamTree tree, Void ignore) {
 854         boolean typaram = tree.isTypeParameter();
 855         IdentifierTree nameTree = tree.getName();
 856         Element paramElement = nameTree != null ? env.trees.getElement(new DocTreePath(getCurrentPath(), nameTree)) : null;

 857         if (paramElement == null) {
 858             switch (env.currElement.getKind()) {
 859                 case CLASS: case INTERFACE: {
 860                     if (!typaram) {
 861                         env.messages.error(REFERENCE, tree, "dc.invalid.param");
 862                         break;
 863                     }
 864                 }
 865                 case METHOD: case CONSTRUCTOR: {
 866                     env.messages.error(REFERENCE, nameTree, "dc.param.name.not.found");
 867                     break;
 868                 }
 869 
 870                 default:
 871                     env.messages.error(REFERENCE, tree, "dc.invalid.param");
 872                     break;
 873             }
 874         } else {
 875             boolean unique = foundParams.add(paramElement);
 876 


< prev index next >