diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index 71b9b37e23..ade5c271a5 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -19,6 +19,7 @@ import hudson.security.ACL; import hudson.security.Permission; import hudson.tasks.BuildTrigger; import hudson.tasks.Publisher; +import hudson.tasks.BuildStep; import hudson.triggers.SCMTrigger; import hudson.triggers.Trigger; import hudson.triggers.TriggerDescriptor; @@ -477,11 +478,20 @@ public abstract class AbstractProject

,R extends A } } + /** + * {@inheritDoc} + * + *

+ * Note that this method returns a read-only view of {@link Action}s. + * {@link BuildStep}s and others who want to add a project action + * should do so by implementing {@link BuildStep#getProjectAction(AbstractProject)}. + */ public synchronized List getActions() { // add all the transient actions, too List actions = new Vector(super.getActions()); actions.addAll(transientActions); - return actions; + // return the read only list to cause a failure on plugins who try to add an action here + return Collections.unmodifiableList(actions); } /**