reflect.ClassPath.from throws URISyntaxException when classpath has a space in it.
When using reflect.ClassPath.from(ClassLoader classLoader), if the classloader involved has loaded classes from a local file containing spaces, a URISyntaxException will be thrown from ClassPath.java line 294.
This bug is caused by the line above it: uri = entry.toURI(); which apparently doesn't work as expected when the URL in question contains spaces.
Maybe we could use the technique described at https://weblogs.java.net/blog/kohsuke/archive/2007/04/how_to_convert.html ?
We don't necessarily have to use URI. The goal is just to turn the URL to a key object with sane hashCode().
Perhaps we can just use URL.getFile() because we only support file:/// urls anyway.
There are two code paths that reach into the scan(URI,ClassLoader) function. One of them can be easily replaced with a URL based solution but the other one which flows from: for (URI uri : getClassPathFromManifest(file, jarFile.getManifest())) { seems more difficult.
I created a fix that makes this work in my environment (appengine devserver on Windows). I can verify that it works in my live tests but it fails some JUnit tests that currently exist. I am not certain that those tests are valid, but since it does fail I won't submit this as a pull request.
Unfortunately I've spent a day on this and it is now working for my company so I probably can't spend any more time on it, but hopefully the commit listed above is helpful!
I think this is fixed with the commit: https://github.com/google/guava/blob/81b23cdc840018da4fc07ccfcd55c78391f44df0/guava-tests/test/com/google/common/reflect/ClassPathTest.java#L274