[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
This commit is contained in:
mindless committed 2010-07-28 21:44:30 +00:00
1 parent 003b78e020
commit de0cd39fa6
1 file changed
+5 -3
+5 -3
View File
@@ -174,7 +174,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
* @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<Dependency> dependencies, List<Dependency> optionalDependencies) {
this.parent = parent;
@@ -187,7 +187,7 @@ public class PluginWrapper implements Comparable<PluginWrapper> {
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<PluginWrapper> {
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) {