Skip to content

Bad Escape exception showing up in log #950

Closed

Description

@martinlippert

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)

Activity

  1. added this to the 4.17.2.RELEASE milestone on Jan 11, 2023
  2. BoykoAlex commented on Jan 12, 2023

    @BoykoAlex
    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 é

  3. BoykoAlex commented on Jan 12, 2023

    @BoykoAlex
    Contributor

    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/lsp4e#358

  4. BoykoAlex commented on Jan 19, 2023

    @BoykoAlex
    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

Metadata

Metadata

Assignees

Labels

for: eclipsetheme: validationtype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions