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:
Uwe Schindler 2010-04-02 16:49:04 +00:00
parent 55aa604871
commit 07424bf640
1 changed files with 1 additions and 1 deletions

View File

@ -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>();