From d2579e568302eb5b4fe6bc80e24d1ba5f73d5bfa Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 14 Oct 2024 14:52:24 -0700 Subject: [PATCH] Try to reproduce an issue that was encountered previously --- pom.xml | 23 ++++--------------- .../git/ApiTokenPropertyConfiguration.java | 6 ++--- .../java/hudson/plugins/git/GitPublisher.java | 4 ++-- src/main/java/hudson/plugins/git/GitSCM.java | 8 +++---- .../java/hudson/plugins/git/GitStatus.java | 16 ++++++------- .../plugins/git/GitStatusCrumbExclusion.java | 8 +++---- .../java/hudson/plugins/git/GitTagAction.java | 8 +++---- .../plugins/git/browser/AssemblaWeb.java | 6 ++--- .../plugins/git/browser/BitbucketServer.java | 4 ++-- .../plugins/git/browser/BitbucketWeb.java | 4 ++-- .../java/hudson/plugins/git/browser/CGit.java | 4 ++-- .../browser/FisheyeGitRepositoryBrowser.java | 6 ++--- .../git/browser/GitBlitRepositoryBrowser.java | 6 ++--- .../hudson/plugins/git/browser/GitLab.java | 6 ++--- .../hudson/plugins/git/browser/GitList.java | 4 ++-- .../git/browser/GitRepositoryBrowser.java | 4 ++-- .../hudson/plugins/git/browser/GitWeb.java | 4 ++-- .../hudson/plugins/git/browser/GithubWeb.java | 4 ++-- .../hudson/plugins/git/browser/Gitiles.java | 6 ++--- .../plugins/git/browser/GitoriousWeb.java | 4 ++-- .../hudson/plugins/git/browser/GogsGit.java | 4 ++-- .../hudson/plugins/git/browser/KilnGit.java | 4 ++-- .../plugins/git/browser/Phabricator.java | 4 ++-- .../plugins/git/browser/RedmineWeb.java | 4 ++-- .../hudson/plugins/git/browser/RhodeCode.java | 4 ++-- .../hudson/plugins/git/browser/Stash.java | 4 ++-- .../browser/TFS2013GitRepositoryBrowser.java | 6 ++--- .../plugins/git/browser/ViewGitWeb.java | 6 ++--- .../git/extensions/impl/PruneStaleTag.java | 4 ++-- .../hudson/plugins/git/util/BuildData.java | 4 ++-- .../jenkins/plugins/git/GitSCMSource.java | 6 ++--- .../hudson/plugins/git/GitStatusTest.java | 10 ++++---- .../plugins/git/GitStatusTheoriesTest.java | 2 +- .../hudson/plugins/git/GitTagActionTest.java | 2 +- .../jenkins/plugins/git/GitSCMSourceTest.java | 2 +- 35 files changed, 93 insertions(+), 108 deletions(-) diff --git a/pom.xml b/pom.xml index fb40d54aa3..073f106259 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 5.1 + 4.88 @@ -66,10 +66,8 @@ -SNAPSHOT jenkinsci/${project.artifactId}-plugin - 2.479 - - - ${jenkins.baseline} + 2.452 + ${jenkins.baseline}.4 false true @@ -78,6 +76,7 @@ false Max Low + InjectedTest @@ -89,13 +88,6 @@ pom import - - - - io.jenkins.plugins.mina-sshd-api - mina-sshd-api-common - 2.14.0-133.vcc091215a_358 - @@ -106,8 +98,6 @@ org.jenkins-ci.plugins git-client - - 6.1.0 org.jenkins-ci.plugins @@ -120,8 +110,6 @@ org.jenkins-ci.plugins scm-api - - 698.v8e3b_c788f0a_6 org.jenkins-ci.plugins @@ -145,9 +133,6 @@ org.jenkins-ci.plugins matrix-project true - - - 822.824.v14451b_c0fd42 org.jenkins-ci.plugins diff --git a/src/main/java/hudson/plugins/git/ApiTokenPropertyConfiguration.java b/src/main/java/hudson/plugins/git/ApiTokenPropertyConfiguration.java index 6dfbe5eaf7..346b121d6e 100644 --- a/src/main/java/hudson/plugins/git/ApiTokenPropertyConfiguration.java +++ b/src/main/java/hudson/plugins/git/ApiTokenPropertyConfiguration.java @@ -14,7 +14,7 @@ import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.Serializable; @@ -58,7 +58,7 @@ public GlobalConfigurationCategory getCategory() { } @RequirePOST - public HttpResponse doGenerate(StaplerRequest2 req) { + public HttpResponse doGenerate(StaplerRequest req) { Jenkins.get().checkPermission(Jenkins.ADMINISTER); String apiTokenName = req.getParameter("apiTokenName"); @@ -102,7 +102,7 @@ private static byte[] hashedBytes(byte[] tokenBytes) { } @RequirePOST - public HttpResponse doRevoke(StaplerRequest2 req) { + public HttpResponse doRevoke(StaplerRequest req) { Jenkins.get().checkPermission(Jenkins.ADMINISTER); String apiTokenUuid = req.getParameter("apiTokenUuid"); diff --git a/src/main/java/hudson/plugins/git/GitPublisher.java b/src/main/java/hudson/plugins/git/GitPublisher.java index 2d2cbdef88..26728dd889 100644 --- a/src/main/java/hudson/plugins/git/GitPublisher.java +++ b/src/main/java/hudson/plugins/git/GitPublisher.java @@ -28,7 +28,7 @@ import org.jenkinsci.plugins.gitclient.UnsupportedCommand; import org.kohsuke.stapler.*; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; @@ -437,7 +437,7 @@ public FormValidation doCheckNoteMsg(@QueryParameter String value) { } public FormValidation doCheckRemote( - @AncestorInPath AbstractProject project, StaplerRequest2 req) + @AncestorInPath AbstractProject project, StaplerRequest req) throws IOException, ServletException { String remote = req.getParameter("value"); boolean isMerge = req.getParameter("isMerge") != null; diff --git a/src/main/java/hudson/plugins/git/GitSCM.java b/src/main/java/hudson/plugins/git/GitSCM.java index e650d9a8e5..ceab12095a 100644 --- a/src/main/java/hudson/plugins/git/GitSCM.java +++ b/src/main/java/hudson/plugins/git/GitSCM.java @@ -66,10 +66,10 @@ import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.export.Exported; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.File; import java.io.IOException; @@ -1884,7 +1884,7 @@ public static PreBuildMergeOptions createMergeOptions(UserMergeOptions mergeOpti return mergeOptions; } - public FormValidation doGitRemoteNameCheck(StaplerRequest2 req) + public FormValidation doGitRemoteNameCheck(StaplerRequest req) throws IOException, ServletException { String mergeRemoteName = req.getParameter("value"); boolean isMerge = req.getParameter("isMerge") != null; @@ -1905,7 +1905,7 @@ public FormValidation doGitRemoteNameCheck(StaplerRequest2 req) } @Override - public boolean configure(StaplerRequest2 req, JSONObject formData) throws FormException { + public boolean configure(StaplerRequest req, JSONObject formData) throws FormException { req.bindJSON(this, formData); save(); return true; diff --git a/src/main/java/hudson/plugins/git/GitStatus.java b/src/main/java/hudson/plugins/git/GitStatus.java index 6d3dba3c39..219acb1e6d 100644 --- a/src/main/java/hudson/plugins/git/GitStatus.java +++ b/src/main/java/hudson/plugins/git/GitStatus.java @@ -19,10 +19,10 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; -import static jakarta.servlet.http.HttpServletResponse.SC_BAD_REQUEST; -import static jakarta.servlet.http.HttpServletResponse.SC_OK; +import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST; +import static javax.servlet.http.HttpServletResponse.SC_OK; import jenkins.model.Jenkins; import jenkins.model.ParameterizedJobMixIn; import jenkins.scm.api.SCMEvent; @@ -180,7 +180,7 @@ public HttpResponse doNotifyCommit(HttpServletRequest request, @QueryParameter(r return new HttpResponse() { @Override - public void generateResponse(StaplerRequest2 req, StaplerResponse2 rsp, Object node) throws IOException { + public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException { rsp.setStatus(SC_OK); rsp.setContentType("text/plain"); for (int i = 0; i < contributors.size(); i++) { @@ -232,7 +232,7 @@ public static class ResponseContributor { * @param rsp the response. * @since 1.4.1 */ - public void addHeaders(StaplerRequest2 req, StaplerResponse2 rsp) { + public void addHeaders(StaplerRequest req, StaplerResponse rsp) { } /** @@ -243,7 +243,7 @@ public void addHeaders(StaplerRequest2 req, StaplerResponse2 rsp) { * @param w the writer. * @since 1.4.1 */ - public void writeBody(StaplerRequest2 req, StaplerResponse2 rsp, PrintWriter w) { + public void writeBody(StaplerRequest req, StaplerResponse rsp, PrintWriter w) { writeBody(w); } @@ -543,7 +543,7 @@ public PollingScheduledResponseContributor(Item project) { */ @Override @SuppressWarnings("deprecation") - public void addHeaders(StaplerRequest2 req, StaplerResponse2 rsp) { + public void addHeaders(StaplerRequest req, StaplerResponse rsp) { // Calls a deprecated getAbsoluteUrl() method because this is a remote API case // as described in the Javadoc of the deprecated getAbsoluteUrl() method. rsp.addHeader("Triggered", project.getAbsoluteUrl()); @@ -578,7 +578,7 @@ public ScheduledResponseContributor(Item project) { */ @Override @SuppressWarnings("deprecation") - public void addHeaders(StaplerRequest2 req, StaplerResponse2 rsp) { + public void addHeaders(StaplerRequest req, StaplerResponse rsp) { // Calls a deprecated getAbsoluteUrl() method because this is a remote API case // as described in the Javadoc of the deprecated getAbsoluteUrl() method. rsp.addHeader("Triggered", project.getAbsoluteUrl()); diff --git a/src/main/java/hudson/plugins/git/GitStatusCrumbExclusion.java b/src/main/java/hudson/plugins/git/GitStatusCrumbExclusion.java index 169b8fb401..72ac266b44 100644 --- a/src/main/java/hudson/plugins/git/GitStatusCrumbExclusion.java +++ b/src/main/java/hudson/plugins/git/GitStatusCrumbExclusion.java @@ -3,10 +3,10 @@ import hudson.Extension; import hudson.security.csrf.CrumbExclusion; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/src/main/java/hudson/plugins/git/GitTagAction.java b/src/main/java/hudson/plugins/git/GitTagAction.java index 9065309681..cc31924127 100644 --- a/src/main/java/hudson/plugins/git/GitTagAction.java +++ b/src/main/java/hudson/plugins/git/GitTagAction.java @@ -11,13 +11,13 @@ import jenkins.model.*; import org.jenkinsci.plugins.gitclient.Git; import org.jenkinsci.plugins.gitclient.GitClient; -import org.kohsuke.stapler.StaplerRequest2; -import org.kohsuke.stapler.StaplerResponse2; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; import org.kohsuke.stapler.interceptor.RequirePOST; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.File; import java.io.IOException; import java.util.*; @@ -149,7 +149,7 @@ public String getTooltip() { * @throws ServletException on servlet error */ @RequirePOST - public synchronized void doSubmit(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException { + public synchronized void doSubmit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { getACL().checkPermission(getPermission()); try (MultipartFormDataParser parser = new MultipartFormDataParser(req)) { diff --git a/src/main/java/hudson/plugins/git/browser/AssemblaWeb.java b/src/main/java/hudson/plugins/git/browser/AssemblaWeb.java index e170f97d95..a9af9b07b8 100644 --- a/src/main/java/hudson/plugins/git/browser/AssemblaWeb.java +++ b/src/main/java/hudson/plugins/git/browser/AssemblaWeb.java @@ -17,11 +17,11 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.interceptor.RequirePOST; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -98,7 +98,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public AssemblaWeb newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public AssemblaWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(AssemblaWeb.class, jsonObject); } diff --git a/src/main/java/hudson/plugins/git/browser/BitbucketServer.java b/src/main/java/hudson/plugins/git/browser/BitbucketServer.java index f88620f960..421c642305 100644 --- a/src/main/java/hudson/plugins/git/browser/BitbucketServer.java +++ b/src/main/java/hudson/plugins/git/browser/BitbucketServer.java @@ -8,7 +8,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -81,7 +81,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public BitbucketServer newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public BitbucketServer newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(BitbucketServer.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/BitbucketWeb.java b/src/main/java/hudson/plugins/git/browser/BitbucketWeb.java index b633b33f3f..d43cad8861 100644 --- a/src/main/java/hudson/plugins/git/browser/BitbucketWeb.java +++ b/src/main/java/hudson/plugins/git/browser/BitbucketWeb.java @@ -8,7 +8,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -82,7 +82,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public BitbucketWeb newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public BitbucketWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(BitbucketWeb.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/CGit.java b/src/main/java/hudson/plugins/git/browser/CGit.java index 4120f60f1b..52c31f32a0 100644 --- a/src/main/java/hudson/plugins/git/browser/CGit.java +++ b/src/main/java/hudson/plugins/git/browser/CGit.java @@ -10,7 +10,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -92,7 +92,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public CGit newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public CGit newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(CGit.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/FisheyeGitRepositoryBrowser.java b/src/main/java/hudson/plugins/git/browser/FisheyeGitRepositoryBrowser.java index de0d3fecd4..dc780d2f18 100644 --- a/src/main/java/hudson/plugins/git/browser/FisheyeGitRepositoryBrowser.java +++ b/src/main/java/hudson/plugins/git/browser/FisheyeGitRepositoryBrowser.java @@ -14,11 +14,11 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.interceptor.RequirePOST; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.IOException; import java.net.URL; import java.util.regex.Pattern; @@ -79,7 +79,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public FisheyeGitRepositoryBrowser newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public FisheyeGitRepositoryBrowser newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(FisheyeGitRepositoryBrowser.class, jsonObject); } diff --git a/src/main/java/hudson/plugins/git/browser/GitBlitRepositoryBrowser.java b/src/main/java/hudson/plugins/git/browser/GitBlitRepositoryBrowser.java index f759411f64..358339cfc4 100644 --- a/src/main/java/hudson/plugins/git/browser/GitBlitRepositoryBrowser.java +++ b/src/main/java/hudson/plugins/git/browser/GitBlitRepositoryBrowser.java @@ -17,11 +17,11 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.interceptor.RequirePOST; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; @@ -84,7 +84,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public GitBlitRepositoryBrowser newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public GitBlitRepositoryBrowser newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(GitBlitRepositoryBrowser.class, jsonObject); } diff --git a/src/main/java/hudson/plugins/git/browser/GitLab.java b/src/main/java/hudson/plugins/git/browser/GitLab.java index eb26e0cee6..3ffc881127 100644 --- a/src/main/java/hudson/plugins/git/browser/GitLab.java +++ b/src/main/java/hudson/plugins/git/browser/GitLab.java @@ -12,14 +12,14 @@ import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import java.io.IOException; import java.net.URL; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import org.kohsuke.stapler.QueryParameter; @@ -145,7 +145,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public GitLab newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public GitLab newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(GitLab.class, jsonObject); } diff --git a/src/main/java/hudson/plugins/git/browser/GitList.java b/src/main/java/hudson/plugins/git/browser/GitList.java index 6bf3cfd32a..4648f56ffd 100644 --- a/src/main/java/hudson/plugins/git/browser/GitList.java +++ b/src/main/java/hudson/plugins/git/browser/GitList.java @@ -10,7 +10,7 @@ import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -94,7 +94,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public GitList newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public GitList newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(GitList.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/GitRepositoryBrowser.java b/src/main/java/hudson/plugins/git/browser/GitRepositoryBrowser.java index 52f441c3f1..814d8ce19d 100644 --- a/src/main/java/hudson/plugins/git/browser/GitRepositoryBrowser.java +++ b/src/main/java/hudson/plugins/git/browser/GitRepositoryBrowser.java @@ -9,7 +9,7 @@ import hudson.scm.RepositoryBrowser; import org.kohsuke.stapler.Stapler; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import java.io.IOException; import java.net.IDN; @@ -46,7 +46,7 @@ public final String getRepoUrl() { public final URL getUrl() throws IOException { String u = url; - StaplerRequest2 req = Stapler.getCurrentRequest2(); + StaplerRequest req = Stapler.getCurrentRequest(); if (req != null) { Job job = req.findAncestorObject(Job.class); if (job != null) { diff --git a/src/main/java/hudson/plugins/git/browser/GitWeb.java b/src/main/java/hudson/plugins/git/browser/GitWeb.java index a0862ec2fc..6f6b232a31 100644 --- a/src/main/java/hudson/plugins/git/browser/GitWeb.java +++ b/src/main/java/hudson/plugins/git/browser/GitWeb.java @@ -10,7 +10,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -94,7 +94,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public GitWeb newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public GitWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(GitWeb.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/GithubWeb.java b/src/main/java/hudson/plugins/git/browser/GithubWeb.java index 6d525d3e75..50b4f00132 100644 --- a/src/main/java/hudson/plugins/git/browser/GithubWeb.java +++ b/src/main/java/hudson/plugins/git/browser/GithubWeb.java @@ -10,7 +10,7 @@ import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -100,7 +100,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public GithubWeb newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public GithubWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(GithubWeb.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/Gitiles.java b/src/main/java/hudson/plugins/git/browser/Gitiles.java index f77251e204..7e6156d63b 100644 --- a/src/main/java/hudson/plugins/git/browser/Gitiles.java +++ b/src/main/java/hudson/plugins/git/browser/Gitiles.java @@ -17,7 +17,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import net.sf.json.JSONObject; @@ -26,7 +26,7 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.interceptor.RequirePOST; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; /** * @author Manolo Carrasco MoƱino @@ -72,7 +72,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public Gitiles newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public Gitiles newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(Gitiles.class, jsonObject); } diff --git a/src/main/java/hudson/plugins/git/browser/GitoriousWeb.java b/src/main/java/hudson/plugins/git/browser/GitoriousWeb.java index 1b728c523c..b9faa07be4 100644 --- a/src/main/java/hudson/plugins/git/browser/GitoriousWeb.java +++ b/src/main/java/hudson/plugins/git/browser/GitoriousWeb.java @@ -8,7 +8,7 @@ import hudson.scm.RepositoryBrowser; import net.sf.json.JSONObject; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -76,7 +76,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public GitoriousWeb newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public GitoriousWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(GitoriousWeb.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/GogsGit.java b/src/main/java/hudson/plugins/git/browser/GogsGit.java index fefa6de35b..0e5f31008a 100644 --- a/src/main/java/hudson/plugins/git/browser/GogsGit.java +++ b/src/main/java/hudson/plugins/git/browser/GogsGit.java @@ -10,7 +10,7 @@ import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -102,7 +102,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public GogsGit newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public GogsGit newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(GogsGit.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/KilnGit.java b/src/main/java/hudson/plugins/git/browser/KilnGit.java index 5bcece4fc8..53d879c13d 100644 --- a/src/main/java/hudson/plugins/git/browser/KilnGit.java +++ b/src/main/java/hudson/plugins/git/browser/KilnGit.java @@ -11,7 +11,7 @@ import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -113,7 +113,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public KilnGit newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public KilnGit newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(KilnGit.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/Phabricator.java b/src/main/java/hudson/plugins/git/browser/Phabricator.java index c511db55be..fd18751715 100644 --- a/src/main/java/hudson/plugins/git/browser/Phabricator.java +++ b/src/main/java/hudson/plugins/git/browser/Phabricator.java @@ -8,7 +8,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -92,7 +92,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public Phabricator newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public Phabricator newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(Phabricator.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/RedmineWeb.java b/src/main/java/hudson/plugins/git/browser/RedmineWeb.java index 5106f56fe1..5820fac961 100644 --- a/src/main/java/hudson/plugins/git/browser/RedmineWeb.java +++ b/src/main/java/hudson/plugins/git/browser/RedmineWeb.java @@ -9,7 +9,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -95,7 +95,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public RedmineWeb newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public RedmineWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(RedmineWeb.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/RhodeCode.java b/src/main/java/hudson/plugins/git/browser/RhodeCode.java index fc11d50fe4..73356106d6 100644 --- a/src/main/java/hudson/plugins/git/browser/RhodeCode.java +++ b/src/main/java/hudson/plugins/git/browser/RhodeCode.java @@ -10,7 +10,7 @@ import net.sf.json.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -97,7 +97,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public RhodeCode newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public RhodeCode newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(RhodeCode.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/Stash.java b/src/main/java/hudson/plugins/git/browser/Stash.java index 71942b227c..b4fa048690 100644 --- a/src/main/java/hudson/plugins/git/browser/Stash.java +++ b/src/main/java/hudson/plugins/git/browser/Stash.java @@ -9,7 +9,7 @@ import hudson.scm.browsers.QueryBuilder; import net.sf.json.JSONObject; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -97,7 +97,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public Stash newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public Stash newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(Stash.class, jsonObject); } } diff --git a/src/main/java/hudson/plugins/git/browser/TFS2013GitRepositoryBrowser.java b/src/main/java/hudson/plugins/git/browser/TFS2013GitRepositoryBrowser.java index fda7468d07..89f99be3d9 100644 --- a/src/main/java/hudson/plugins/git/browser/TFS2013GitRepositoryBrowser.java +++ b/src/main/java/hudson/plugins/git/browser/TFS2013GitRepositoryBrowser.java @@ -16,11 +16,11 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.interceptor.RequirePOST; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; @@ -95,7 +95,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public TFS2013GitRepositoryBrowser newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public TFS2013GitRepositoryBrowser newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { try { req.getSubmittedForm(); } catch (ServletException e) { diff --git a/src/main/java/hudson/plugins/git/browser/ViewGitWeb.java b/src/main/java/hudson/plugins/git/browser/ViewGitWeb.java index f5ec81299d..27bf8bdc33 100644 --- a/src/main/java/hudson/plugins/git/browser/ViewGitWeb.java +++ b/src/main/java/hudson/plugins/git/browser/ViewGitWeb.java @@ -18,11 +18,11 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.interceptor.RequirePOST; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; @@ -91,7 +91,7 @@ public String getDisplayName() { @Override @SuppressFBWarnings(value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE", justification = "Inherited javadoc commits that req is non-null") - public ViewGitWeb newInstance(StaplerRequest2 req, @NonNull JSONObject jsonObject) throws FormException { + public ViewGitWeb newInstance(StaplerRequest req, @NonNull JSONObject jsonObject) throws FormException { return req.bindJSON(ViewGitWeb.class, jsonObject); } diff --git a/src/main/java/hudson/plugins/git/extensions/impl/PruneStaleTag.java b/src/main/java/hudson/plugins/git/extensions/impl/PruneStaleTag.java index a50e92528c..70815d5dbe 100644 --- a/src/main/java/hudson/plugins/git/extensions/impl/PruneStaleTag.java +++ b/src/main/java/hudson/plugins/git/extensions/impl/PruneStaleTag.java @@ -47,7 +47,7 @@ import org.jenkinsci.plugins.gitclient.FetchCommand; import org.jenkinsci.plugins.gitclient.GitClient; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; /** * Prune stale local tags that do not exist on any remote. @@ -166,7 +166,7 @@ public String toString() { public static class DescriptorImpl extends GitSCMExtensionDescriptor { @Override - public GitSCMExtension newInstance(StaplerRequest2 req, JSONObject formData) throws FormException { + public GitSCMExtension newInstance(StaplerRequest req, JSONObject formData) throws FormException { return new PruneStaleTag(true); } diff --git a/src/main/java/hudson/plugins/git/util/BuildData.java b/src/main/java/hudson/plugins/git/util/BuildData.java index de9c1c8c63..ba4cb6d783 100644 --- a/src/main/java/hudson/plugins/git/util/BuildData.java +++ b/src/main/java/hudson/plugins/git/util/BuildData.java @@ -21,7 +21,7 @@ import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.Stapler; -import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; @@ -141,7 +141,7 @@ public Integer getIndex() { @Restricted(NoExternalUse.class) // only used from stapler/jelly @CheckForNull public Run getOwningRun() { - StaplerRequest2 req = Stapler.getCurrentRequest2(); + StaplerRequest req = Stapler.getCurrentRequest(); if (req == null) { return null; } diff --git a/src/main/java/jenkins/plugins/git/GitSCMSource.java b/src/main/java/jenkins/plugins/git/GitSCMSource.java index a18116b5b1..536b845b38 100644 --- a/src/main/java/jenkins/plugins/git/GitSCMSource.java +++ b/src/main/java/jenkins/plugins/git/GitSCMSource.java @@ -107,8 +107,8 @@ import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest2; -import org.kohsuke.stapler.StaplerResponse2; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.interceptor.RequirePOST; /** @@ -671,7 +671,7 @@ public boolean isMatch(@NonNull SCM scm) { result.add(new GitStatus.ResponseContributor() { @Override @SuppressWarnings("deprecation") - public void addHeaders(StaplerRequest2 req, StaplerResponse2 rsp) { + public void addHeaders(StaplerRequest req, StaplerResponse rsp) { // Calls a deprecated getAbsoluteUrl() method because this is a remote API case // as described in the Javadoc of the deprecated getAbsoluteUrl() method. rsp.addHeader("Triggered", owner.getAbsoluteUrl()); diff --git a/src/test/java/hudson/plugins/git/GitStatusTest.java b/src/test/java/hudson/plugins/git/GitStatusTest.java index 64637ccd8b..ce0a133867 100644 --- a/src/test/java/hudson/plugins/git/GitStatusTest.java +++ b/src/test/java/hudson/plugins/git/GitStatusTest.java @@ -33,10 +33,10 @@ import org.junit.Test; import org.jvnet.hudson.test.Issue; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.StaplerRequest2; -import org.kohsuke.stapler.StaplerResponse2; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; public class GitStatusTest extends AbstractGitProject { @@ -536,8 +536,8 @@ public void testDoNotifyCommitTriggeredHeadersLimited() throws Exception { HttpResponse rsp = this.gitStatus.doNotifyCommit(requestWithNoParameter, "a", "master", null, notifyCommitApiToken); // Up to 10 "Triggered" headers + 1 extra warning are returned. - StaplerRequest2 sReq = mock(StaplerRequest2.class); - StaplerResponse2 sRsp = mock(StaplerResponse2.class); + StaplerRequest sReq = mock(StaplerRequest.class); + StaplerResponse sRsp = mock(StaplerResponse.class); Mockito.when(sRsp.getWriter()).thenReturn(mock(PrintWriter.class)); rsp.generateResponse(sReq, sRsp, null); Mockito.verify(sRsp, Mockito.times(11)).addHeader(Mockito.eq("Triggered"), Mockito.anyString()); diff --git a/src/test/java/hudson/plugins/git/GitStatusTheoriesTest.java b/src/test/java/hudson/plugins/git/GitStatusTheoriesTest.java index 42a2a03fac..cf9ce2af1d 100644 --- a/src/test/java/hudson/plugins/git/GitStatusTheoriesTest.java +++ b/src/test/java/hudson/plugins/git/GitStatusTheoriesTest.java @@ -21,7 +21,7 @@ import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; @RunWith(Theories.class) public class GitStatusTheoriesTest extends AbstractGitProject { diff --git a/src/test/java/hudson/plugins/git/GitTagActionTest.java b/src/test/java/hudson/plugins/git/GitTagActionTest.java index 3623053407..de424fbc8f 100644 --- a/src/test/java/hudson/plugins/git/GitTagActionTest.java +++ b/src/test/java/hudson/plugins/git/GitTagActionTest.java @@ -48,7 +48,7 @@ import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.TestExtension; -import jakarta.servlet.ServletException; +import javax.servlet.ServletException; /** * Test git tag action. Low value test that was created as part of diff --git a/src/test/java/jenkins/plugins/git/GitSCMSourceTest.java b/src/test/java/jenkins/plugins/git/GitSCMSourceTest.java index df9b80c75e..40efa21490 100644 --- a/src/test/java/jenkins/plugins/git/GitSCMSourceTest.java +++ b/src/test/java/jenkins/plugins/git/GitSCMSourceTest.java @@ -49,7 +49,7 @@ import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.Collections; import org.jvnet.hudson.test.TestExtension;