提交 93b27380 编写于 作者: S stephenconnolly

ProminentProjectAction does not work as expected for MavenModule. This is...

ProminentProjectAction does not work as expected for MavenModule.  This is because getProminentActions() is a method of Project and not AbstractProject.

To my mind, getProminentActions should be a method of AbstractProject.  If specific project types (i.e. MavenModuleSet or MatrixProject) don't want the concept of ProminentProjectAction they can override the method to return an empty set, or but this default behaviour of filtering all actions and returning only the ones that implement ProminentProjectAction seems best placed in AbstractProject.

See http://www.nabble.com/Getting-ProminentProjectAction-to-work-to14724625.html


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6556 71c3de6d-444a-0410-be80-ed276b4c234a
上级 73029fd7
......@@ -271,6 +271,16 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
}
}
public List<ProminentProjectAction> getProminentActions() {
List<Action> a = getActions();
List<ProminentProjectAction> pa = new Vector<ProminentProjectAction>();
for (Action action : a) {
if(action instanceof ProminentProjectAction)
pa.add((ProminentProjectAction) action);
}
return pa;
}
@Override
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
super.doConfigSubmit(req,rsp);
......
......@@ -184,16 +184,6 @@ public abstract class Project<P extends Project<P,B>,B extends Build<P,B>>
}
}
public List<ProminentProjectAction> getProminentActions() {
List<Action> a = getActions();
List<ProminentProjectAction> pa = new Vector<ProminentProjectAction>();
for (Action action : a) {
if(action instanceof ProminentProjectAction)
pa.add((ProminentProjectAction) action);
}
return pa;
}
/**
* @deprecated
* left for legacy config file compatibility
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册