diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java index f1ceb29280b..bbcb880b414 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java @@ -2259,7 +2259,9 @@ private Expression convertLiteral(JCLiteral literal) { } private Statement convertStatement(JCStatement javac, ASTNode parent) { - if (TreeInfo.getEndPos(javac, this.javacCompilationUnit.endPositions) <= javac.getPreferredPosition()) { + int endPos = TreeInfo.getEndPos(javac, this.javacCompilationUnit.endPositions); + int preferredPos = javac.getPreferredPosition(); + if (endPos < preferredPos) { return null; } if (javac instanceof JCReturn returnStatement) {