From de0cd39fa6ee5be82d7e0fd3eac1eb78a2c4914d Mon Sep 17 00:00:00 2001 From: mindless Date: Wed, 28 Jul 2010 21:44:30 +0000 Subject: [PATCH] [FIXED HUDSON-6966] in getIndexPage(), check that result has this plugin's artifactId in it, in case plugin has dependencies but is missing its own index.jelly. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@33311 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/PluginWrapper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index 02dfc378fd..e57ea496d3 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -174,7 +174,7 @@ public class PluginWrapper implements Comparable { * @param dependencies a list of mandatory dependencies * @param optionalDependencies a list of optional dependencies */ - public PluginWrapper(PluginManager parent, File archive, Manifest manifest, URL baseResourceURL, + public PluginWrapper(PluginManager parent, File archive, Manifest manifest, URL baseResourceURL, ClassLoader classLoader, File disableFile, List dependencies, List optionalDependencies) { this.parent = parent; @@ -187,7 +187,7 @@ public class PluginWrapper implements Comparable { this.active = !disableFile.exists(); this.dependencies = dependencies; this.optionalDependencies = optionalDependencies; - } + } /** * Returns the URL of the index page jelly script. @@ -201,7 +201,9 @@ public class PluginWrapper implements Comparable { while (en.hasMoreElements()) idx = en.nextElement(); } catch (IOException ignore) { } - return idx; + // In case plugin has dependencies but is missing its own index.jelly, + // check that result has this plugin's artifactId in it: + return idx != null && idx.toString().contains(shortName) ? idx : null; } private String computeShortName(Manifest manifest, File archive) {