correctly handle ambgious cases (such as when we run in the development mode)

This commit is contained in:
Kohsuke Kawaguchi committed 2012-02-19 09:45:43 +09:00
1 parent 87ee2bbcc3
commit e3cf985819
1 file changed
+7 -3
+7 -3
View File
@@ -538,12 +538,16 @@ public abstract class PluginManager extends AbstractModelObject {
* @since 1.402.
*/
public PluginWrapper whichPlugin(Class c) {
PluginWrapper oneAndOnly = null;
ClassLoader cl = c.getClassLoader();
for (PluginWrapper p : activePlugins) {
if (p.classLoader==cl)
return p;
if (p.classLoader==cl) {
if (oneAndOnly!=null)
return null; // ambigious
oneAndOnly = p;
}
}
return null;
return oneAndOnly;
}
/**