[FIXED HUDSON-6966] Plugins with dependencies show wrong description on

installed plugins page.  DependencyClassLoader checks dependencies before
this plugin, so wrong index.jelly is found for plugins with dependencies.
Added implementation of findResources in DependencyClassLoader, and use
getResources to find the right index.jelly in PluginWrapper.getIndexPage().


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@32876 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
mindless committed 2010-07-14 16:32:26 +00:00
1 parent 3c4dd890e1
commit 81b3603c13
4 files changed
+101 -3

No files matched your search

@@ -39,9 +39,12 @@ import java.io.Closeable;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.jar.Manifest;
import java.util.jar.Attributes;
import java.util.logging.Logger;
@@ -380,7 +383,20 @@ public class ClassicPluginStrategy implements PluginStrategy {
throw new ClassNotFoundException(name);
}
// TODO: delegate resources? watch out for diamond dependencies
@Override
protected Enumeration<URL> findResources(String name) throws IOException {
HashSet<URL> result = new HashSet<URL>();
for (Dependency dep : dependencies) {
PluginWrapper p = pluginManager.getPlugin(dep.shortName);
if (p!=null) {
Enumeration<URL> urls = p.classLoader.getResources(name);
while (urls != null && urls.hasMoreElements())
result.add(urls.nextElement());
}
}
return Collections.enumeration(result);
}
@Override
protected URL findResource(String name) {