Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8273244: Improve diagnostic output related to ErroneousTree #5510

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -265,9 +265,6 @@ public long getStartPosition(CompilationUnitTree file, DocCommentTree comment, D
public long getEndPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree) {
DCDocComment dcComment = (DCDocComment) comment;
DCTree dcTree = (DCTree) tree;
if (dcComment.getSourcePosition(dcTree.getEndPosition()) == 0) {
System.err.println("WARNING: comment:" + dcComment.comment + ": " + dcTree.getKind() + " end:" + dcTree.getEndPosition() + " result: " + dcComment.getSourcePosition(dcTree.getEndPosition()));
}
return dcComment.getSourcePosition(dcTree.getEndPosition());
}
};
@@ -968,7 +968,7 @@ protected void addPendingText(ListBuffer<DCTree> list, int textEnd) {

/**
* Creates an {@code ErroneousTree} node, for a range of text starting at a given position,
* ending at the last non-white character before the current position,
* ending at the last non-whitespace character before the current position,
* and with the preferred position set to the last character within that range.
*
* @param code the resource key for the error message
@@ -982,8 +982,8 @@ protected DCErroneous erroneous(String code, int pos) {

/**
* Creates an {@code ErroneousTree} node, for a range of text starting at a given position,
* ending at the last non-white character before the current position,
* and with a given preferred position
* ending at the last non-whitespace character before the current position,
* and with a given preferred position.
*
* @param code the resource key for the error message
* @param pos the starting position
@@ -71,7 +71,7 @@
* <li>the {@link #getEndPosition() end} of the range of characters for this node
* </ul>
*
* All are values relative to the beginning of the
* All values are relative to the beginning of the
* {@link Elements#getDocComment comment text} in which they appear.
* To convert a value to the position in the enclosing source text,
* use {@link DCDocComment#getSourcePosition(int)}.
@@ -262,7 +262,7 @@ public Void scan(DocTree node, Void p) {
/**
* {@return a diagnostic position based on the positions in a comment}
*
* The positions are lazily converted to file-based positions as needed.
* The positions are lazily converted to file-based positions, as needed.
*
* @param comment the enclosing comment
* @param start the start position in the comment
@@ -696,7 +696,7 @@ private boolean isSentenceBreak(DocTree dt, boolean isFirstDocTree) {
}

/*
* Returns the position of the the first non-white space
* Returns the position of the first non-whitespace character.
*/
private int skipWhiteSpace(String s, int start) {
for (int i = start; i < s.length(); i++) {
@@ -23,7 +23,7 @@

/*
* @test
* @bug 7021614 8273244 8273244
* @bug 7021614 8273244
* @summary extend com.sun.source API to support parsing javadoc comments
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file