Skip to content

Commit

Permalink
Merge pull request #372 from basil/jakarta
Browse files Browse the repository at this point in the history
Migrate from EE 8 to EE 9
  • Loading branch information
jglick authored Jan 23, 2025
2 parents fb5780d + 6cd40f7 commit 4fb69c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>5.5</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down Expand Up @@ -64,8 +64,8 @@
<properties>
<changelist>999999-SNAPSHOT</changelist>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.452</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.4</jenkins.version>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<no-test-jar>false</no-test-jar>
<useBeta>true</useBeta>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down Expand Up @@ -62,7 +62,7 @@ public FormValidation doCheckDurabilityHint(@QueryParameter("durabilityHint") St
}

@Override
public boolean configure(StaplerRequest req, JSONObject json) {
public boolean configure(StaplerRequest2 req, JSONObject json) {
// TODO verify if this is covered by permissions checks or we need an explicit check here.
Object ob = json.opt("durabilityHint");
FlowDurabilityHint hint = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.Beta;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;

/**
* Some utility code extracted from {@link AnnotatedLargeText} which probably belongs in {@link ConsoleAnnotator} or {@link ConsoleAnnotationOutputStream}.
Expand All @@ -64,7 +64,7 @@ public class ConsoleAnnotators {
* What to pass to {@link ConsoleAnnotationOutputStream#ConsoleAnnotationOutputStream} when overriding {@link AnnotatedLargeText#writeHtmlTo}.
*/
public static <T> ConsoleAnnotator<T> createAnnotator(T context) throws IOException {
StaplerRequest req = Stapler.getCurrentRequest();
StaplerRequest2 req = Stapler.getCurrentRequest2();
try {
String base64 = req != null ? req.getHeader("X-ConsoleAnnotator") : null;
if (base64 != null) {
Expand Down Expand Up @@ -98,7 +98,7 @@ public static void setAnnotator(ConsoleAnnotator<?> annotator) throws IOExceptio
oos.writeLong(System.currentTimeMillis());
oos.writeObject(annotator);
}
StaplerResponse rsp = Stapler.getCurrentResponse();
StaplerResponse2 rsp = Stapler.getCurrentResponse2();
if (rsp != null) {
rsp.setHeader("X-ConsoleAnnotator", new String(Base64.getEncoder().encode(baos.toByteArray()), StandardCharsets.US_ASCII));
}
Expand Down

0 comments on commit 4fb69c3

Please sign in to comment.