From a78f1d3246cfdbee96820d5629dbb8676a3ca19a Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Thu, 9 Oct 2014 17:01:58 +0400 Subject: [PATCH] [FIXED JENKINS-24340] - Do not disable jobs if supportsMakeDisabled() returns false This changes prevents the improper usage of method without the preliminary supportsMakeDisabled() check. As an example, Subversion plugin behaves in such way (JENKINS-24341) Signed-off-by: Oleg Nenashev --- core/src/main/java/hudson/model/AbstractProject.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index 6e36007578..462342f0a5 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -690,9 +690,13 @@ public abstract class AbstractProject

,R extends A /** * Marks the build as disabled. + * The method will ignore the disable command if {@link #supportsMakeDisabled()} + * returns false. The enable command will be executed in any case. + * @param b true - disable, false - enable */ public void makeDisabled(boolean b) throws IOException { if(disabled==b) return; // noop + if (b && !supportsMakeDisabled()) return; // do nothing if the disabling is unsupported this.disabled = b; if(b) Jenkins.getInstance().getQueue().cancel(this); -- GitLab