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

StringIndexOutOfBoundsException in JDTUtils.getPackageName(IJavaProject, URI) #373

Closed
snjeza opened this issue Oct 2, 2017 · 0 comments
Closed
Assignees

Comments

@snjeza
Copy link
Contributor

snjeza commented Oct 2, 2017

The issue happens when creating a new file in the src directory.
It is similar to redhat-developer/vscode-java#312

Stacktrace [Error - 1:02:17 AM] Request textDocument/codeAction failed. Message: Internal error, please look at the server's logs. Code: -32603 [Error - 1:02:17 AM] Request textDocument/codeLens failed. Message: Internal error, please look at the server's logs. Code: -32603 [Error - 1:02:22 AM] Oct 3, 2017 12:59:45 AM Problem with codeComplete for file:///home/snjeza/testlsp/teststandalone/foo/src/T.java String index out of range: -1 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1931) at org.eclipse.jdt.ls.core.internal.JDTUtils.getPackageName(JDTUtils.java:203) at org.eclipse.jdt.ls.core.internal.JDTUtils.getFakeCompilationUnit(JDTUtils.java:158) at org.eclipse.jdt.ls.core.internal.JDTUtils.resolveCompilationUnit(JDTUtils.java:136) at org.eclipse.jdt.ls.core.internal.JDTUtils.resolveCompilationUnit(JDTUtils.java:109) at org.eclipse.jdt.ls.core.internal.handlers.CompletionHandler.completion(CompletionHandler.java:37) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$3(JDTLanguageServer.java:275) at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

[Error - 1:02:23 AM] Request textDocument/codeLens failed.
Message: Internal error, please look at the server's logs.
Code: -32603
[Error - 1:02:23 AM] Request textDocument/codeLens failed.
Message: Internal error, please look at the server's logs.
Code: -32603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants