Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork77
Open
Description
Did you check docs and existing issues?
- I have read all the plugin docs
- I have searched the existing issues
- I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
v0.12.0-dev
Operating system/version
Ubuntu 24.04.2 LTS
Describe the bug
Trying to format some of the Java files fails with errors like:
[ERROR][2025-08-10 16:27:23] ...p/_transport.lua:36"rpc""java""stderr""Aug 10, 2025 4:27:23 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseErrorSEVERE: Internal error: java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 64java.util.concurrent.CompletionException: java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 64\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)\tat java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)Caused by: java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 64\tat java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)\tat java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)\tat java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)\tat java.base/java.util.Objects.checkIndex(Objects.java:385)\tat java.base/java.util.ArrayList.get(ArrayList.java:427)\tat org.eclipse.jdt.internal.formatter.TokenManager.get(TokenManager.java:78)\tat org.eclipse.jdt.internal.formatter.TokenManager.findIndex(TokenManager.java:172)\tat org.eclipse.jdt.internal.formatter.TokenManager.lastIndexIn(TokenManager.java:205)\tat org.eclipse.jdt.internal.formatter.LineBreaksPreparator.handleBracedCode(LineBreaksPreparator.java:664)\tat org.eclipse.jdt.internal.formatter.LineBreaksPreparator.visit(LineBreaksPreparator.java:229)\tat org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:652)\tat org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)\tat org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3383)\tat org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:497)\tat org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)\tat org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3383)\tat org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:257)\tat org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)\tat org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.prepareLineBreaks(DefaultCodeFormatter.java:418)\tat org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.prepareFormattedCode(DefaultCodeFormatter.java:229)\tat org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:185)\tat org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:169)\tat org.eclipse.jdt.ls.core.internal.handlers.FormatterHandler.format(FormatterHandler.java:120)\tat org.eclipse.jdt.ls.core.internal.handlers.FormatterHandler.format(FormatterHandler.java:107)\tat org.eclipse.jdt.ls.core.internal.handlers.FormatterHandler.formatting(FormatterHandler.java:78)\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$19(JDTLanguageServer.java:840)\tat org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)\t... 6 more"Removing/commenting parts of the code I've figured out that if I delete/comment lombok imports formatting starts working again.
Steps To Reproduce
I've created minimum reproducible example, using Spring Initializr:DemoApplication.java.
Withimport lombok.AllArgsConstructor; trying to format this file produces error above for me. When I comment this line - formatting works again.
Expected Behavior
Java files are formatted without an error. The same file formatting works in VS Code, so I assume this is not an issue with a language server itself (maybe an issue with server version though).