Skip to content

Commit

Permalink
[FIXED JENKINS-18356] Restored deprecated AbstractProject.doBuild{,Wi…
Browse files Browse the repository at this point in the history
…thParameters} overloads.
  • Loading branch information
jglick committed Jun 14, 2013
1 parent 26b1362 commit fa47981
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -58,6 +58,9 @@
<li class=bug>
“Build Now” link did not work for multijobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16974">issue 16974</a>)
<li class='major bug'>
Fixed API incompatibility since 1.489.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18356">issue 18356</a>)
<li class=bug>
“Projects tied to slave” shows unrelated Maven module jobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17451">issue 17451</a>)
Expand Down
14 changes: 13 additions & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -1812,6 +1812,12 @@ public void doBuild( StaplerRequest req, StaplerResponse rsp, @QueryParameter Ti
rsp.sendRedirect(".");
}

/** @deprecated use {@link #doBuild(StaplerRequest, StaplerResponse, TimeDuration)} */
@Deprecated
public void doBuild(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
doBuild(req, rsp, TimeDuration.fromString(req.getParameter("delay")));
}

/**
* Computes the build cause, using RemoteCause or UserCause as appropriate.
*/
Expand All @@ -1830,7 +1836,7 @@ public void doBuild( StaplerRequest req, StaplerResponse rsp, @QueryParameter Ti
/**
* Computes the delay by taking the default value and the override in the request parameter into the account.
*
* @deprecated as of 1.488
* @deprecated as of 1.489
* Inject {@link TimeDuration}.
*/
public int getDelay(StaplerRequest req) throws ServletException {
Expand Down Expand Up @@ -1863,6 +1869,12 @@ public void doBuildWithParameters(StaplerRequest req, StaplerResponse rsp, @Quer

}

/** @deprecated use {@link #doBuildWithParameters(StaplerRequest, StaplerResponse, TimeDuration)} */
@Deprecated
public void doBuildWithParameters(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
doBuildWithParameters(req, rsp, TimeDuration.fromString(req.getParameter("delay")));
}

/**
* Schedules a new SCM polling command.
*/
Expand Down
Expand Up @@ -47,6 +47,7 @@
import org.kohsuke.stapler.export.ExportedBean;

import hudson.Extension;
import javax.annotation.CheckForNull;
import org.kohsuke.stapler.export.Flavor;

import static javax.servlet.http.HttpServletResponse.SC_CREATED;
Expand Down Expand Up @@ -105,6 +106,8 @@ public Collection<Action> getJobActions(AbstractProject<?, ?> job) {
return (AbstractProject<?, ?>) owner;
}

/** @deprecated use {@link #_doBuild(StaplerRequest, StaplerResponse, TimeDuration)} */
@Deprecated
public void _doBuild(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
_doBuild(req,rsp,TimeDuration.fromString(req.getParameter("delay")));
}
Expand Down Expand Up @@ -144,11 +147,13 @@ public void _doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter Ti
rsp.sendRedirect(".");
}

/** @deprecated use {@link #buildWithParameters(StaplerRequest, StaplerResponse, TimeDuration)} */
@Deprecated
public void buildWithParameters(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
buildWithParameters(req,rsp,TimeDuration.fromString(req.getParameter("delay")));
}

public void buildWithParameters(StaplerRequest req, StaplerResponse rsp, TimeDuration delay) throws IOException, ServletException {
public void buildWithParameters(StaplerRequest req, StaplerResponse rsp, @CheckForNull TimeDuration delay) throws IOException, ServletException {
List<ParameterValue> values = new ArrayList<ParameterValue>();
for (ParameterDefinition d: parameterDefinitions) {
ParameterValue value = d.createValue(req);
Expand Down

0 comments on commit fa47981

Please sign in to comment.