Bug 571112 - org.eclipse.core.runtime.URIUtil.append(URI, String) has insufficient path-handling
Summary: org.eclipse.core.runtime.URIUtil.append(URI, String) has insufficient path-ha...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-11 03:03 EST by Moritz Strübe CLA
Modified: 2022-05-31 07:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Strübe CLA 2021-02-11 03:03:20 EST
When having a URL like file:////WSL$/... java.net.URI.getPath() will return /WSL$/.... When passing this to java.net.URI() as path-parameter, the first element is not interpreted as path, but as Authority, which does not support the $ (see backtrace)(IMO this is a bug in the java-lib).
While this problem occurred using the Winows-WSL, this can occur with any root-path containing special characters (-at least if I did not miss anything).

java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in hostname at index 10: file://WSL$/Ubuntu/home/[..]
	at org.eclipse.core.runtime.URIUtil.append(URIUtil.java:85)
	at org.eclipse.cdt.core.EFSExtensionProvider.append(EFSExtensionProvider.java:166)
	at org.eclipse.cdt.utils.EFSExtensionManager.append(EFSExtensionManager.java:216)
	at org.eclipse.cdt.core.ErrorParserManager.toURI(ErrorParserManager.java:758)
	at org.eclipse.cdt.core.ErrorParserManager.findFileInWorkspace(ErrorParserManager.java:498)
[..]
Caused by: java.net.URISyntaxException: Illegal character in hostname at index 10: file://WSL$/Ubuntu/home/morty/[..]
	at java.base/java.net.URI$Parser.fail(URI.java:2963)
	at java.base/java.net.URI$Parser.parseHostname(URI.java:3498)
	at java.base/java.net.URI$Parser.parseServer(URI.java:3347)
	at java.base/java.net.URI$Parser.parseAuthority(URI.java:3266)
	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3208)
	at java.base/java.net.URI$Parser.parse(URI.java:3164)
	at java.base/java.net.URI.<init>(URI.java:708)
	at org.eclipse.core.runtime.URIUtil.append(URIUtil.java:75)
Comment 1 Moritz Strübe CLA 2022-05-31 07:46:24 EDT
This seems related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=207103