From 96797e92e84a8d6e78ae5f3dff6fc009dc79079b Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Tue, 3 Sep 2024 12:03:23 -0700 Subject: [PATCH] https://github.com/jenkinsci/jenkins/pull/9672#discussion_r1742273929 --- .../main/java/jenkins/model/ParameterizedJobMixIn.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java index a0115cba2a74..ea8437510818 100644 --- a/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java +++ b/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java @@ -436,7 +436,15 @@ default void doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter Ti * @see ParameterizedJobMixIn#doBuildWithParameters */ default void doBuildWithParameters(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException { - getParameterizedJobMixIn().doBuildWithParameters(req, rsp, delay); + if (Util.isOverridden(ParameterizedJob.class, getClass(), "doBuildWithParameters", StaplerRequest.class, StaplerResponse.class, TimeDuration.class)) { + try { + doBuildWithParameters(StaplerRequest.fromStaplerRequest2(req), StaplerResponse.fromStaplerResponse2(rsp), delay); + } catch (javax.servlet.ServletException e) { + throw ServletExceptionWrapper.toJakartaServletException(e); + } + } else { + getParameterizedJobMixIn().doBuildWithParameters(req, rsp, delay); + } } /**