Skip to content

Commit 11c94f4

Browse files
committed
Avoid exception converting AST with empty variable fragments
1 parent 93b7b6d commit 11c94f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,6 +2792,9 @@ private void removeSurroundingWhitespaceFromRange(ASTNode res) {
27922792
}
27932793

27942794
private void removeTrailingCharFromRange(ASTNode res, char[] possible) {
2795+
if (res.getLength() == 0) {
2796+
return;
2797+
}
27952798
int endPos = res.getStartPosition() + res.getLength();
27962799
char lastChar = this.rawText.charAt(endPos-1);
27972800
boolean found = false;

0 commit comments

Comments
 (0)