com.sun.source.doctree.ErroneousTree Java Examples

The following examples show how to use com.sun.source.doctree.ErroneousTree. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavadocConverter.java    From j2objc with Apache License 2.0 6 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree node, TagElement tag) {
  if (reportWarnings) {
    // Update node's position to be relative to the whole source file, instead of just
    // the doc-comment's start. That way, the diagnostic printer will fetch the correct
    // text for the line the error is on.
    ((DCTree.DCErroneous) node).pos =
        ((DCTree) node).pos((DCTree.DCDocComment) docComment).getStartPosition();
    ErrorUtil.warning(node.getDiagnostic().toString());
  } else {
    // Include erroneous text in doc-comment as is.
    TreeNode newNode = setPos(node, new TextElement().setText(node.getBody()));
    tag.addFragment(newNode);
  }
  return null;
}
 
Example #2
Source File: DocCommentProcessor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #3
Source File: DocCommentProcessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #4
Source File: DocCommentProcessor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #5
Source File: DocCommentProcessor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #6
Source File: DocCommentProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #7
Source File: DocCommentProcessor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #8
Source File: DocCommentProcessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #9
Source File: DocCommentProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void check() {
    DocCommentTree dc = trees.getDocCommentTree(getCurrentPath());
    if (dc == null)
        return;

    DocTreeScanner<Void, Void> s = new DocTreeScanner<Void, Void>() {
        @Override
        public Void visitErroneous(ErroneousTree tree, Void ignore) {
            messager.printMessage(Diagnostic.Kind.NOTE, tree.getDiagnostic().getMessage(null));
            return null;
        }
    };

    s.scan(dc, null);
}
 
Example #10
Source File: ImmutableDocTreeTranslator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public DocTree visitErroneous(ErroneousTree tree, Object p) {
    return rewriteChildren(tree);
}
 
Example #11
Source File: Checker.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #12
Source File: Checker.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #13
Source File: Checker.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #14
Source File: Checker.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #15
Source File: Checker.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #16
Source File: Checker.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #17
Source File: Checker.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #18
Source File: Checker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree tree, Void ignore) {
    env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
    return null;
}
 
Example #19
Source File: Analyzer.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree node, List<ErrorDescription> errors) {
    return super.visitErroneous(node, errors);
}
 
Example #20
Source File: RefactoringVisitor.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public DocTree visitErroneous(ErroneousTree node, Element p, Void ignore) {
    return super.visitErroneous(node, p);
}
 
Example #21
Source File: RefactoringVisitor.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public DocTree visitErroneous(ErroneousTree node, Element p) {
    return instance.visitErroneous(node, p);
}
 
Example #22
Source File: RefactoringVisitor.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/**
 * @since 1.47
 */
@Override
public DocTree visitErroneous(ErroneousTree node, Element p) {
    return docScanner.visitErroneous(node, p, null);
}
 
Example #23
Source File: VeryPretty.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Void visitErroneous(ErroneousTree node, Void p) {
    print(node.getBody());
    return null;
}
 
Example #24
Source File: ImmutableDocTreeTranslator.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected final ErroneousTree rewriteChildren(ErroneousTree tree) {
    return tree; // XXX: Not implemented yet
}
 
Example #25
Source File: DocTreeFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Create a new {@code ErroneousTree} object, to represent some unparseable input.
 * @param text the unparseable text
 * @param diag a diagnostic associated with the unparseable text, or null
 * @return an {@code ErroneousTree} object
 */
ErroneousTree newErroneousTree(String text, Diagnostic<JavaFileObject> diag);
 
Example #26
Source File: DocTreeFactory.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Create a new {@code ErroneousTree} object, to represent some unparseable input.
 * @param text the unparseable text
 * @param diag a diagnostic associated with the unparseable text, or null
 * @return an {@code ErroneousTree} object
 */
ErroneousTree newErroneousTree(String text, Diagnostic<JavaFileObject> diag);