Closed
Description
Summary
ClassPath.getTopLevelClasses() returns empty list when the path of the classloader contains special characters.
How to reproduce this error
- Create a packeage with three classes
- Create the following unit test
@Test
public void testMain() throws Exception {
ClassLoader loader = this.getClass().getClassLoader();
ClassPath p = ClassPath.from(loader);
ImmutableSet<ClassPath.ClassInfo> list = p.getTopLevelClasses("testpackage");
Assert.assertEquals(3, list.size());
}
- Copy the whole project to a folder with special characters in its name (like % for example) and execute it.
- The test will fail. If you copy the project to a folder without special characters in its path the test will pass.