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

Bad Escape exception showing up in log #950

Closed
martinlippert opened this issue Jan 11, 2023 · 3 comments
Closed

Bad Escape exception showing up in log #950

martinlippert opened this issue Jan 11, 2023 · 3 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse theme: validation type: bug

Comments

@martinlippert
Copy link
Member

This is showing up in the language server log of my dev environment:

java.lang.IllegalArgumentException: Bad escape
	at java.base/sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:88)
	at java.base/sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:102)
	at java.base/java.nio.file.Path.of(Path.java:203)
	at java.base/java.nio.file.Paths.get(Paths.java:98)
	at org.springframework.ide.vscode.boot.java.utils.SpringFactoriesIndexer.isInterestedIn(SpringFactoriesIndexer.java:87)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.lambda$getDocumentsInterestingForIndexer$18(SpringSymbolIndex.java:477)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getDocumentsInterestingForIndexer(SpringSymbolIndex.java:477)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.updateDocuments(SpringSymbolIndex.java:442)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.lambda$serverInitialized$6(SpringSymbolIndex.java:222)
	at org.springframework.ide.vscode.commons.util.BasicFileObserver.lambda$notify$5(BasicFileObserver.java:129)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.concurrent.ConcurrentHashMap$ValueSpliterator.forEachRemaining(ConcurrentHashMap.java:3612)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at org.springframework.ide.vscode.commons.util.BasicFileObserver.notify(BasicFileObserver.java:129)
	at org.springframework.ide.vscode.commons.util.BasicFileObserver.notifyFilesChanged(BasicFileObserver.java:89)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleWorkspaceService.didChangeWatchedFiles(SimpleWorkspaceService.java:106)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.springframework.ide.vscode.commons.languageserver.util.ParentProcessWatcher.lambda$apply$0(ParentProcessWatcher.java:129)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
@BoykoAlex
Copy link
Contributor

Invalid URI looks like: file:///Users/aboyko/git/sts4/headless-services/spring-boot-language-server/target/test-classes/test-projects/test-annotation-indexing-parent/test-annotation-indexing%20with%20space/src/main/java/org/test/ClassWithSpécialCharacter.java

Spacial character cannot be escaped it seems - namely é

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Jan 12, 2023

This seems like a change requiring the code base swept for proper usage of URI#toString() vs URI#toASCIIString(). The code base to sweep would be STS4 and LSP4E. VSCode sends proper URI string representation with non-ASCII chars escaped i.e. ClassWithSp%C3%A9cialCharacter.java. This would probably be some time effort to look at all such spots... I'd probably replace all or majority of toString() with toASCIIString()

I'm curious on reaction in LSP4E on this: eclipse/lsp4e#358

@BoykoAlex
Copy link
Contributor

Should be fixed with 8db3165 Also LSP4E issues is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse theme: validation type: bug
Projects
None yet
Development

No branches or pull requests

2 participants