mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 12:02:20 +00:00
correctly handle ambgious cases (such as when we run in the development mode)
This commit is contained in:
1 parent
87ee2bbcc3
commit
e3cf985819
1 file changed
+7
-3
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user