mirror of https://github.com/apache/lucene.git
Fix broken MBean test: new File(URL.getPath()) is the wrong way to create filenames from "file:" URLs coming from Classloader. The problem: some characters are escaped, e.g. the whitespace in my user's home directory. The correct way is to cast to URI using toURI() and invoking the URI-ctor in File (this is the "official" way to go).
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@930323 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
55aa604871
commit
07424bf640
|
@ -89,7 +89,7 @@ public class SolrInfoMBeanTest extends TestCase
|
|||
String path = pckgname.replace('.', '/');
|
||||
Enumeration<URL> resources = cld.getResources(path);
|
||||
while (resources.hasMoreElements()) {
|
||||
directories.add(new File(resources.nextElement().getPath()));
|
||||
directories.add(new File(resources.nextElement().toURI()));
|
||||
}
|
||||
|
||||
ArrayList<Class> classes = new ArrayList<Class>();
|
||||
|
|
Loading…
Reference in New Issue