Skip to content

Commit

Permalink
Migrate to Jakarta EE 9 (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Nov 13, 2024
1 parent e74f2ff commit 18a80fb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>5.2</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -53,8 +53,8 @@
<revision>1.29</revision>
<changelist>-SNAPSHOT</changelist>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.440</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<!-- TODO fix existing violations -->
<spotbugs.threshold>High</spotbugs.threshold>
Expand All @@ -65,7 +65,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>3435.v238d66a_043fb_</version>
<version>3654.v237e4a_f2d8da_</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import net.sf.json.JSONObject;

import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public class ListViewSection extends SectionedViewSection {

Expand All @@ -75,7 +75,7 @@ public static List<ListViewColumn> getDefaultColumns() {
Descriptor<ListViewColumn> des = all.find(d);
if (des != null) {
try {
r.add(des.newInstance(null, null));
r.add(des.newInstance((StaplerRequest2) null, null));
} catch (FormException e) {
LOGGER.log(Level.WARNING, "Failed to instantiate "+des.clazz,e);
}
Expand All @@ -89,7 +89,7 @@ public static List<ListViewColumn> getDefaultColumns() {
public static final class DescriptorImpl extends SectionedViewSectionDescriptor {

@Override
public SectionedViewSection newInstance(StaplerRequest req, JSONObject formData) throws FormException {
public SectionedViewSection newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
ListViewSection section = (ListViewSection) super.newInstance(req, formData);

if (section.columns == null) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/hudson/plugins/sectioned_view/SectionedView.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
import java.util.SortedSet;
import java.util.TreeSet;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;

import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;

public class SectionedView extends View {

Expand Down Expand Up @@ -147,7 +147,7 @@ public static Result getResult(Job job) {
* Load view-specific properties here.
*/
@Override
protected void submit(StaplerRequest req) throws ServletException, FormException {
protected void submit(StaplerRequest2 req) throws ServletException, FormException {
initSections();
try {
sections.rebuildHetero(req, req.getSubmittedForm(), Hudson
Expand Down Expand Up @@ -178,7 +178,7 @@ public boolean contains(TopLevelItem item) {
}

@Override
public Item doCreateItem(StaplerRequest req, StaplerResponse rsp)
public Item doCreateItem(StaplerRequest2 req, StaplerResponse2 rsp)
throws IOException, ServletException {
return Hudson.getInstance().doCreateItem(req, rsp);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;

import hudson.model.Items;
import hudson.model.TopLevelItem;
import net.sf.json.JSONObject;

import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

import hudson.Util;
import hudson.model.Descriptor;
Expand All @@ -60,7 +60,7 @@ public boolean hasJobFilterExtensions() {
}

@Override
public SectionedViewSection newInstance(StaplerRequest req, JSONObject formData) throws FormException {
public SectionedViewSection newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
SectionedViewSection section = (SectionedViewSection)req.bindJSON(getClass().getDeclaringClass(), formData);

if (formData.get("useincluderegex") != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/sectioned_view/TextSection.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public class TextSection extends SectionedViewSection {

Expand Down Expand Up @@ -72,7 +72,7 @@ public boolean hasStyle() {
public static final class DescriptorImpl extends SectionedViewSectionDescriptor {

@Override
public SectionedViewSection newInstance(StaplerRequest req, JSONObject formData) throws FormException {
public SectionedViewSection newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
return (SectionedViewSection)req.bindJSON(getClass().getDeclaringClass(), formData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public class ViewListingSection extends SectionedViewSection {

Expand Down Expand Up @@ -111,7 +111,7 @@ public List<Collection<View>> getNestedViewColumns(ViewGroup viewGroup) {
public static final class DescriptorImpl extends SectionedViewSectionDescriptor {

@Override
public SectionedViewSection newInstance(StaplerRequest req, JSONObject formData) throws FormException {
public SectionedViewSection newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
int columns = formData.getInt("columns");
if (columns <= 0) throw new FormException("Columns must be a number greater than 0", "columns");
return (SectionedViewSection)req.bindJSON(getClass().getDeclaringClass(), formData);
Expand Down

0 comments on commit 18a80fb

Please sign in to comment.