Skip to content

Commit

Permalink
Missing names must have length 0, not length 7 representing <error>
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Dec 9, 2024
1 parent 99781c9 commit 0615a26
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
import com.sun.tools.javac.parser.ParserFactory;
import com.sun.tools.javac.parser.Tokens.Comment;
import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.TreeInfo;
import com.sun.tools.javac.tree.DCTree.DCDocComment;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCAnnotatedType;
import com.sun.tools.javac.tree.JCTree.JCAnnotation;
import com.sun.tools.javac.tree.JCTree.JCAnyPattern;
Expand Down Expand Up @@ -125,6 +124,7 @@
import com.sun.tools.javac.tree.JCTree.JCWildcard;
import com.sun.tools.javac.tree.JCTree.JCYield;
import com.sun.tools.javac.tree.JCTree.Tag;
import com.sun.tools.javac.tree.TreeInfo;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.JCDiagnostic;
import com.sun.tools.javac.util.Log;
Expand Down Expand Up @@ -2877,7 +2877,8 @@ private IfStatement convertIfStatement(JCIf javac) {
Type convertToType(JCTree javac) {
if (javac instanceof JCIdent ident) {
Name name = convertName(ident.name);
name.setSourceRange(ident.getStartPosition(), ident.name.length());
int len = FAKE_IDENTIFIER.equals(name.toString()) ? 0 : ident.name.length();
name.setSourceRange(ident.getStartPosition(), len);
SimpleType res = this.ast.newSimpleType(name);
commonSettings(res, ident);
commonSettings(name, ident);
Expand Down

0 comments on commit 0615a26

Please sign in to comment.