|
16 | 16 | import java.util.List;
|
17 | 17 | import java.util.logging.Level;
|
18 | 18 | import java.util.logging.Logger;
|
19 |
| -import javax.servlet.ServletException; |
| 19 | +import jakarta.servlet.ServletException; |
20 | 20 | import jenkins.model.Jenkins;
|
21 | 21 | import jenkins.scm.api.SCMEvent;
|
22 | 22 | import jenkins.scm.api.SCMHeadEvent;
|
|
31 | 31 | import org.kohsuke.stapler.HttpResponses;
|
32 | 32 | import org.kohsuke.stapler.QueryParameter;
|
33 | 33 | import org.kohsuke.stapler.Stapler;
|
34 |
| -import org.kohsuke.stapler.StaplerRequest; |
35 |
| -import org.kohsuke.stapler.StaplerResponse; |
| 34 | +import org.kohsuke.stapler.StaplerRequest2; |
| 35 | +import org.kohsuke.stapler.StaplerResponse2; |
36 | 36 | import org.springframework.security.core.Authentication;
|
37 | 37 |
|
38 |
| -import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST; |
39 |
| -import static javax.servlet.http.HttpServletResponse.SC_OK; |
| 38 | +import static jakarta.servlet.http.HttpServletResponse.SC_BAD_REQUEST; |
| 39 | +import static jakarta.servlet.http.HttpServletResponse.SC_OK; |
40 | 40 | /**
|
41 | 41 | * Information screen for the use of Mercurial in Jenkins.
|
42 | 42 | */
|
@@ -106,7 +106,7 @@ static boolean looselyMatches(URI notifyUri, String repository) {
|
106 | 106 | public HttpResponse doNotifyCommit(@QueryParameter(required=true) final String url,
|
107 | 107 | @QueryParameter String branch,
|
108 | 108 | @QueryParameter String changesetId) throws ServletException, IOException {
|
109 |
| - String origin = SCMEvent.originOf(Stapler.getCurrentRequest()); |
| 109 | + String origin = SCMEvent.originOf(Stapler.getCurrentRequest2()); |
110 | 110 | // run in high privilege to see all the projects anonymous users don't see.
|
111 | 111 | // this is safe because we only initiate polling.
|
112 | 112 | // But we shouldn't disclose the item names to users that is not supposed to see them
|
@@ -202,7 +202,7 @@ private HttpResponse handleNotifyCommit(String origin, URI url, final Authentica
|
202 | 202 |
|
203 | 203 | return new HttpResponse() {
|
204 | 204 | @SuppressWarnings("deprecation")
|
205 |
| - public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { |
| 205 | + public void generateResponse(StaplerRequest2 req, StaplerResponse2 rsp, Object node) throws IOException, ServletException { |
206 | 206 | rsp.setStatus(SC_OK);
|
207 | 207 | rsp.setContentType("text/plain");
|
208 | 208 | for (Item p : projects) {
|
|
0 commit comments