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

No diagnostics, but org.eclipse.jface.text.BadLocationException #1223

Open
jrieken opened this issue Jan 3, 2020 · 5 comments
Open

No diagnostics, but org.eclipse.jface.text.BadLocationException #1223

jrieken opened this issue Jan 3, 2020 · 5 comments
Labels
ls-error/crash need verify The fix is available, need verify from user

Comments

@jrieken
Copy link

jrieken commented Jan 3, 2020

No compile errors showing in the editor...

Environment
Steps To Reproduce
  1. Open Java-file, write semantic errors, like adding a bad reference
  2. Save
Current Result

No compile errors, console show exceptions

[Error - 11:16:47 AM] Jan 3, 2020, 11:16:47 AM 
null
org.eclipse.jface.text.BadLocationException
	at org.eclipse.jface.text.ListLineTracker.getLineOffset(ListLineTracker.java:197)
	at org.eclipse.jface.text.AbstractLineTracker.getLineOffset(AbstractLineTracker.java:161)
	at org.eclipse.jface.text.AbstractDocument.getLineOffset(AbstractDocument.java:876)
	at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOffset(SynchronizableDocument.java:323)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.convertRange(WorkspaceDiagnosticsHandler.java:371)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.toDiagnostic(WorkspaceDiagnosticsHandler.java:348)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.lambda$3(WorkspaceDiagnosticsHandler.java:332)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.toDiagnosticsArray(WorkspaceDiagnosticsHandler.java:334)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.visit(WorkspaceDiagnosticsHandler.java:171)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:51)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.resourceChanged(WorkspaceDiagnosticsHandler.java:95)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:305)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:295)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:158)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:380)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1502)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:169)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

[Error - 11:17:05 AM] Jan 3, 2020, 11:17:05 AM 
null
org.eclipse.jface.text.BadLocationException
	at org.eclipse.jface.text.ListLineTracker.getLineOffset(ListLineTracker.java:197)
	at org.eclipse.jface.text.AbstractLineTracker.getLineOffset(AbstractLineTracker.java:161)
	at org.eclipse.jface.text.AbstractDocument.getLineOffset(AbstractDocument.java:876)
	at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOffset(SynchronizableDocument.java:323)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.convertRange(WorkspaceDiagnosticsHandler.java:371)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.toDiagnostic(WorkspaceDiagnosticsHandler.java:348)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.lambda$3(WorkspaceDiagnosticsHandler.java:332)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.toDiagnosticsArray(WorkspaceDiagnosticsHandler.java:334)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.visit(WorkspaceDiagnosticsHandler.java:171)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:51)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceDiagnosticsHandler.resourceChanged(WorkspaceDiagnosticsHandler.java:95)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:305)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:295)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:158)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:380)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1502)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:169)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

@akaroml
Copy link
Contributor

akaroml commented Jan 16, 2020

@testforstephen please take a look.

@ivenxu
Copy link

ivenxu commented Feb 26, 2020

The same happens to me. This is the most inconvenient one for me.

@testforstephen
Copy link
Collaborator

In the latest 0.59.1, we pushed a fix about BadLocationException, see eclipse-jdtls/eclipse.jdt.ls#1374. @jrieken @ivenxu Could you check again whether this issue still reproduce? thanks.

@testforstephen testforstephen added the need verify The fix is available, need verify from user label Apr 8, 2020
@tigerinus
Copy link

tigerinus commented Oct 10, 2021

Start seeing this error recently:

[Error - 9:41:36 PM] Oct 10, 2021, 9:41:36 PM Offset > length: 2462 > 0
Offset > length: 2462 > 0
org.eclipse.jface.text.BadLocationException: Offset > length: 2462 > 0
	at org.eclipse.jface.text.ListLineTracker.getLineNumberOfOffset(ListLineTracker.java:141)
	at org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:155)
	at org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:872)
	at org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:156)
	at org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:101)
	at org.eclipse.jdt.ls.core.internal.JDTUtils.toRange(JDTUtils.java:856)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.getCodeLens(CodeLensHandler.java:254)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.collectCodeLenses(CodeLensHandler.java:223)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.collectCodeLenses(CodeLensHandler.java:208)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.getCodeLensSymbols(CodeLensHandler.java:189)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$17(JDTLanguageServer.java:679)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

[Error - 9:41:36 PM] Oct 10, 2021, 9:41:36 PM Offset > length: 2481 > 0
Offset > length: 2481 > 0
org.eclipse.jface.text.BadLocationException: Offset > length: 2481 > 0
	at org.eclipse.jface.text.ListLineTracker.getLineNumberOfOffset(ListLineTracker.java:141)
	at org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:155)
	at org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:872)
	at org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:156)
	at org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:101)
	at org.eclipse.jdt.ls.core.internal.JDTUtils.toRange(JDTUtils.java:857)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.getCodeLens(CodeLensHandler.java:254)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.collectCodeLenses(CodeLensHandler.java:223)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.collectCodeLenses(CodeLensHandler.java:208)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeLensHandler.getCodeLensSymbols(CodeLensHandler.java:189)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$17(JDTLanguageServer.java:679)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

auto-completion is alway "loading..."

@LethDz
Copy link

LethDz commented Mar 28, 2022

Recently, it still happens, when my computer comes to sleep and turns it back on.
Or just leave the vs-code for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ls-error/crash need verify The fix is available, need verify from user
Projects
None yet
Development

No branches or pull requests

6 participants