Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakarta EE 9+ migration #266

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ GEM
PLATFORMS
universal-java-1.8
universal-java-11
universal-java-17

DEPENDENCIES
appraisal (< 1.0)
Expand Down
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,27 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<version>2.3.6</version>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
<version>2.0.3</version>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -139,12 +145,6 @@
<version>3.2.18.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/jruby/rack/AbstractFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.jruby.rack.servlet.RequestCapture;
import org.jruby.rack.servlet.ResponseCapture;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/jruby/rack/AbstractServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.jruby.rack.servlet.ServletRackEnvironment;
import org.jruby.rack.servlet.ServletRackResponseEnvironment;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jruby/rack/RackDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package org.jruby.rack;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import java.io.IOException;

/**
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/org/jruby/rack/RackEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/**
* Represent a Rack environment (that will most likely by wrapping a
* {@link javax.servlet.http.HttpServletRequest}).
* {@link jakarta.servlet.http.HttpServletRequest}).
* Allows Rack applications to be loaded outside of JEE servlet environments.
*
* @see org.jruby.rack.servlet.ServletRackEnvironment
Expand All @@ -38,7 +38,7 @@ public interface RackEnvironment {
// The following methods are specific to the rack environment

/**
* @see javax.servlet.ServletRequest#getInputStream()
* @see jakarta.servlet.ServletRequest#getInputStream()
* @return the input as a stream
* @throws IOException if there's an IO exception
*/
Expand All @@ -54,107 +54,107 @@ public interface RackEnvironment {
// The following methods are usually inherited from the servlet request

/**
* @see javax.servlet.http.HttpServletRequest#getPathInfo()
* @see jakarta.servlet.http.HttpServletRequest#getPathInfo()
* @return the request path info
*/
public String getPathInfo();

/**
* Request URI should include the query string if available.
* @see javax.servlet.http.HttpServletRequest#getRequestURI()
* @see jakarta.servlet.http.HttpServletRequest#getRequestURI()
* @return the request URI
*/
public String getRequestURI();

/**
* @see javax.servlet.http.HttpServletRequest#getAttributeNames()
* @see jakarta.servlet.http.HttpServletRequest#getAttributeNames()
* @return an enumeration of all attribute names
*/
public Enumeration<String> getAttributeNames();

/**
* @see javax.servlet.http.HttpServletRequest#getAttribute(String)
* @see jakarta.servlet.http.HttpServletRequest#getAttribute(String)
* @param key the attribute key
* @return the attribute value
*/
public Object getAttribute(String key);

/**
* @see javax.servlet.http.HttpServletRequest#setAttribute(String, Object)
* @see jakarta.servlet.http.HttpServletRequest#setAttribute(String, Object)
* @param key the key
* @param value the value
*/
public void setAttribute(String key, Object value);

/**
* @see javax.servlet.http.HttpServletRequest#getHeaderNames()
* @see jakarta.servlet.http.HttpServletRequest#getHeaderNames()
* @return an enumeration of all header names
*/
public Enumeration<String> getHeaderNames();

/**
* @see javax.servlet.http.HttpServletRequest#getHeader(String)
* @see jakarta.servlet.http.HttpServletRequest#getHeader(String)
* @param name the header name
* @return the header value
*/
public String getHeader(String name);

/**
* @see javax.servlet.http.HttpServletRequest#getScheme()
* @see jakarta.servlet.http.HttpServletRequest#getScheme()
* @return the request scheme
*/
public String getScheme();

/**
* @see javax.servlet.http.HttpServletRequest#getContentType()
* @see jakarta.servlet.http.HttpServletRequest#getContentType()
* @return the content type
*/
public String getContentType();

/**
* @see javax.servlet.http.HttpServletRequest#getContentLength()
* @see jakarta.servlet.http.HttpServletRequest#getContentLength()
* @return the content length
*/
public int getContentLength();

/**
* @see javax.servlet.http.HttpServletRequest#getMethod()
* @see jakarta.servlet.http.HttpServletRequest#getMethod()
* @return the request method
*/
public String getMethod();

/**
* @see javax.servlet.http.HttpServletRequest#getQueryString()
* @see jakarta.servlet.http.HttpServletRequest#getQueryString()
* @return the query string
*/
public String getQueryString();

/**
* @see javax.servlet.http.HttpServletRequest#getServerName()
* @see jakarta.servlet.http.HttpServletRequest#getServerName()
* @return the server name
*/
public String getServerName();

/**
* @see javax.servlet.http.HttpServletRequest#getServerPort()
* @see jakarta.servlet.http.HttpServletRequest#getServerPort()
* @return the server port
*/
public int getServerPort();

/**
* @see javax.servlet.ServletRequest#getRemoteHost()
* @see jakarta.servlet.ServletRequest#getRemoteHost()
* @return the remote host
*/
public String getRemoteHost();

/**
* @see javax.servlet.ServletRequest#getRemoteAddr()
* @see jakarta.servlet.ServletRequest#getRemoteAddr()
* @return the remote address
*/
public String getRemoteAddr();

/**
* @see javax.servlet.http.HttpServletRequest#getRemoteUser()
* @see jakarta.servlet.http.HttpServletRequest#getRemoteUser()
* @return the remote user
*/
public String getRemoteUser();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/jruby/rack/RackFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

import java.io.IOException;
import java.net.MalformedURLException;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;

import org.jruby.rack.servlet.RequestCapture;
import org.jruby.rack.servlet.ResponseCapture;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/org/jruby/rack/RackResponseEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* handle and return the Rack response) interface.
* It is likely to be (only) implemented as a HTTP servlet response.
*
* @see javax.servlet.ServletResponse
* @see javax.servlet.http.HttpServletResponse
* @see jakarta.servlet.ServletResponse
* @see jakarta.servlet.http.HttpServletResponse
* @see RackResponse
*
* @author nicksieger
Expand All @@ -26,30 +26,30 @@ public interface RackResponseEnvironment {

/**
* @return whether the underlying response has been committed.
* @see javax.servlet.ServletResponse#isCommitted()
* @see jakarta.servlet.ServletResponse#isCommitted()
*/
boolean isCommitted();

/**
* Reset the response (buffer) so we can begin a new response.
* @see javax.servlet.ServletResponse#reset()
* @see jakarta.servlet.ServletResponse#reset()
*/
void reset();

/**
* @see javax.servlet.ServletResponse#setContentType(String)
* @see jakarta.servlet.ServletResponse#setContentType(String)
* @param type the content type
*/
void setContentType(String type) ;

/**
* @see javax.servlet.ServletResponse#setContentLength(int)
* @see jakarta.servlet.ServletResponse#setContentLength(int)
* @param length the content length
*/
void setContentLength(int length) ;

/**
* @see javax.servlet.ServletResponse#setCharacterEncoding(String)
* @see jakarta.servlet.ServletResponse#setCharacterEncoding(String)
* @param charset the charset
*/
void setCharacterEncoding(String charset) ;
Expand Down Expand Up @@ -107,14 +107,14 @@ public interface RackResponseEnvironment {
void sendError(int code) throws IOException ;

/**
* @see javax.servlet.ServletResponse#getOutputStream()
* @see jakarta.servlet.ServletResponse#getOutputStream()
* @return the output stream
* @throws IOException if there's an IO exception
*/
OutputStream getOutputStream() throws IOException ;

/**
* @see javax.servlet.ServletResponse#getWriter()
* @see jakarta.servlet.ServletResponse#getWriter()
* @return the writer
* @throws IOException if there's an IO exception
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jruby/rack/RackServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package org.jruby.rack;

import javax.servlet.ServletConfig;
import jakarta.servlet.ServletConfig;

@SuppressWarnings("serial")
public class RackServlet extends AbstractServlet {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jruby/rack/RackServletContextListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

package org.jruby.rack;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;

import org.jruby.rack.servlet.DefaultServletRackContext;
import org.jruby.rack.servlet.ServletRackConfig;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/jruby/rack/RackTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

import org.jruby.rack.servlet.ServletRackEnvironment;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.tagext.TagSupport;

@SuppressWarnings("serial")
public class RackTag extends TagSupport {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/jruby/rack/UnmappedRackFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletResponse;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletResponse;

import org.jruby.rack.servlet.RequestCapture;
import org.jruby.rack.servlet.ResponseCapture;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jruby/rack/embed/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
package org.jruby.rack.embed;

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

import org.jruby.rack.AbstractFilter;
import org.jruby.rack.RackContext;
Expand Down
Loading