提交 78e09522 编写于 作者: J Jesse Glick

getParameterizedJobMixIn turned out to be unnecessary.

上级 9f19ae91
......@@ -287,7 +287,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return buildMixIn;
}
@Override public synchronized ParameterizedJobMixIn<P,R> getParameterizedJobMixIn() {
private synchronized ParameterizedJobMixIn<P,R> getParameterizedJobMixIn() {
if (parameterizedJobMixIn == null) {
parameterizedJobMixIn = new ParameterizedJobMixIn<P,R>() {
@SuppressWarnings("unchecked") // untypable
......
......@@ -175,7 +175,7 @@ public class ParametersDefinitionProperty extends JobProperty<Job<?, ?>>
if (delay==null) delay=new TimeDuration(getJob().getQuietPeriod());
Jenkins.getInstance().getQueue().schedule(
getJob(), delay.getTime(), new ParametersAction(values), getJob().getParameterizedJobMixIn().getBuildCause(req));
getJob(), delay.getTime(), new ParametersAction(values), ParameterizedJobMixIn.getBuildCause(getJob(), req));
if (requestWantsJson(req)) {
rsp.setContentType("application/json");
......
......@@ -171,7 +171,7 @@ public abstract class ParameterizedJobMixIn<JobT extends Job<JobT, RunT> & Param
throw HttpResponses.error(SC_INTERNAL_SERVER_ERROR, new IOException(asJob().getFullName() + " is not buildable"));
}
Queue.Item item = Jenkins.getInstance().getQueue().schedule2(asJob(), delay.getTime(), getBuildCause(req)).getItem();
Queue.Item item = Jenkins.getInstance().getQueue().schedule2(asJob(), delay.getTime(), getBuildCause(asJob(), req)).getItem();
if (item != null) {
rsp.sendRedirect(SC_CREATED, req.getContextPath() + '/' + item.getUrl());
} else {
......@@ -223,10 +223,10 @@ public abstract class ParameterizedJobMixIn<JobT extends Job<JobT, RunT> & Param
* Computes the build cause, using RemoteCause or UserCause as appropriate.
*/
@Restricted(NoExternalUse.class)
public final CauseAction getBuildCause(StaplerRequest req) {
public static final CauseAction getBuildCause(ParameterizedJob job, StaplerRequest req) {
Cause cause;
@SuppressWarnings("deprecation")
hudson.model.BuildAuthorizationToken authToken = asJob().getAuthToken();
hudson.model.BuildAuthorizationToken authToken = job.getAuthToken();
if (authToken != null && authToken.getToken() != null && req.getParameter("token") != null) {
// Optional additional cause text when starting via token
String causeText = req.getParameter("cause");
......@@ -251,8 +251,6 @@ public abstract class ParameterizedJobMixIn<JobT extends Job<JobT, RunT> & Param
*/
public interface ParameterizedJob extends hudson.model.Queue.Task {
ParameterizedJobMixIn<?,?> getParameterizedJobMixIn();
@SuppressWarnings("deprecation")
@CheckForNull hudson.model.BuildAuthorizationToken getAuthToken();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册