Skip to content

Commit

Permalink
Issue #152 - Renaming javax -> jakarta
Browse files Browse the repository at this point in the history
+ javax.servlet -> jakarta.servlet
+ javax.el -> jakarta.el

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Apr 6, 2020
1 parent 29a02da commit 7f7b0ea
Show file tree
Hide file tree
Showing 37 changed files with 239 additions and 258 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<!--svn|mercurial|git - defaults to svn-->
<scm>git</scm>
<!-- turn on/off debugging -->
<debug>off</debug>
<debug>false</debug>
<!-- skip files not under SCM-->
<scmOnly>true</scmOnly>
<!-- turn off warnings -->
Expand Down
50 changes: 31 additions & 19 deletions impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.eclipse.ee4j</groupId>
<artifactId>project</artifactId>
<version>1.0.1</version>
<version>1.0.6</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -274,12 +274,23 @@
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<id>jakarta.oss.releases</id>
<name>Jakarta Public Releases</name>
<url>https://jakarta.oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
<id>java.net.Releases</id>
Expand All @@ -290,30 +301,31 @@

<dependencies>
<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-M1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>[3.0.1-b10,)</version>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>4.0.0-RC1</version>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>

<!--
Needed only if we include JDTJavaCompiler.java
<dependency>
<groupId>eclipse</groupId>
<artifactId>jdtcore</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
-->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.7</version>
</dependency>
<dependency>
<groupId>eclipse</groupId>
<artifactId>jdtcore</artifactId>
<version>3.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
8 changes: 4 additions & 4 deletions impl/src/main/java/org/apache/jasper/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public class Constants {
* Servlet context and request attributes that the JSP engine
* uses.
*/
public static final String INC_REQUEST_URI = "javax.servlet.include.request_uri";
public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
public static final String TMP_DIR = "javax.servlet.context.tempdir";
public static final String FORWARD_SEEN = "javax.servlet.forward.seen";
public static final String INC_REQUEST_URI = "jakarta.servlet.include.request_uri";
public static final String INC_SERVLET_PATH = "jakarta.servlet.include.servlet_path";
public static final String TMP_DIR = "jakarta.servlet.context.tempdir";
public static final String FORWARD_SEEN = "jakarta.servlet.forward.seen";
public static final String FIRST_REQUEST_SEEN = "jspx.1st.request";

// Must be kept in sync with org/apache/catalina/Globals.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
import java.util.logging.Level;
import java.text.MessageFormat;

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

import org.apache.jasper.runtime.TldScanner;
import org.apache.jasper.compiler.JspConfig;
import org.apache.jasper.compiler.TagPluginManager;
import org.apache.jasper.compiler.Localizer;
import org.apache.jasper.xmlparser.ParserUtils;

/**
* A class to hold all init parameters specific to the JSP engine.
Expand Down Expand Up @@ -531,7 +530,7 @@ public EmbeddedServletOptions(ServletConfig config,
if (dir != null) {
scratchDir = new File(dir);
} else {
// First try the Servlet 2.2 javax.servlet.context.tempdir property
// First try the Servlet 2.2 jakarta.servlet.context.tempdir property
scratchDir = (File) context.getAttribute(Constants.TMP_DIR);
if (scratchDir == null) {
// Not running in a Servlet 2.2 container.
Expand Down
2 changes: 1 addition & 1 deletion impl/src/main/java/org/apache/jasper/JasperException.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @author Anil K. Vijendran
*/
public class JasperException extends javax.servlet.ServletException {
public class JasperException extends jakarta.servlet.ServletException {

public JasperException(String reason) {
super(reason);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.Set;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;
import jakarta.servlet.jsp.tagext.TagInfo;
import jakarta.servlet.jsp.tagext.TagLibraryInfo;

import org.apache.jasper.compiler.Compiler;
import org.apache.jasper.compiler.JspRuntimeContext;
Expand Down
8 changes: 2 additions & 6 deletions impl/src/main/java/org/apache/jasper/compiler/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.HashSet;

import javax.el.ValueExpression;
import javax.el.MethodExpression;

import jakarta.servlet.jsp.tagext.TagAttributeInfo;
import jakarta.servlet.jsp.tagext.TagInfo;
import jakarta.servlet.jsp.tagext.TagVariableInfo;
Expand Down Expand Up @@ -558,7 +554,7 @@ private void generatePreamble(Node.Nodes page) throws JasperException {
out.printil("if (exception != null) {");
out.pushIndent();
out.printil(
"response.setStatus((Integer)request.getAttribute(\"javax.servlet.error.status_code\"));");
"response.setStatus((Integer)request.getAttribute(\"jakarta.servlet.error.status_code\"));");
out.popIndent();
out.printil("}");
}
Expand Down Expand Up @@ -2864,7 +2860,7 @@ private String evaluateAttribute(
// then type is adjusted accordingly.
if (attrType == Object.class &&
attr.getEL().hasPoundExpression()) {
attrType = javax.el.ValueExpression.class;
attrType = jakarta.el.ValueExpression.class;
}
attrValue =
JspUtil.interpreterCall(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.io.InputStream;
import java.net.URL;
import java.util.*;
import javax.servlet.ServletContext;
import jakarta.servlet.jsp.tagext.FunctionInfo;
import jakarta.servlet.jsp.tagext.TagLibraryInfo;
import jakarta.servlet.jsp.tagext.TagInfo;
Expand Down
8 changes: 3 additions & 5 deletions impl/src/main/java/org/apache/jasper/compiler/JspConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@

package org.apache.jasper.compiler;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.logging.Logger;
import java.util.logging.Level;

import javax.servlet.ServletContext;
import javax.servlet.descriptor.JspConfigDescriptor;
import javax.servlet.descriptor.JspPropertyGroupDescriptor;
import jakarta.servlet.ServletContext;
import jakarta.servlet.descriptor.JspConfigDescriptor;
import jakarta.servlet.descriptor.JspPropertyGroupDescriptor;

import org.apache.jasper.JasperException;
import org.apache.jasper.Constants;

/**
* Handles the jsp-config element in WEB_INF/web.xml. This is used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@
import java.security.cert.Certificate;
import java.security.PermissionCollection;
import java.security.Policy;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.*;
import java.util.logging.Logger;
import java.util.logging.Level;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;
import jakarta.servlet.jsp.JspFactory;
import javax.tools.JavaFileObject;

Expand Down
10 changes: 5 additions & 5 deletions impl/src/main/java/org/apache/jasper/compiler/JspUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import javax.el.ELException;
import javax.el.FunctionMapper;
import javax.el.ExpressionFactory;
import jakarta.el.ELException;
import jakarta.el.FunctionMapper;
import jakarta.el.ExpressionFactory;

import org.apache.jasper.Constants;
import org.apache.jasper.JasperException;
Expand Down Expand Up @@ -497,7 +497,7 @@ public static String interpreterCall(boolean isTagFile,
else
jspCtxt = "_jspx_page_context";

if (expectedType == javax.el.ValueExpression.class) {
if (expectedType == jakarta.el.ValueExpression.class) {

if (expectedDeferredType == null) {
expectedDeferredType = "java.lang.Object";
Expand All @@ -511,7 +511,7 @@ public static String interpreterCall(boolean isTagFile,

}

if (expectedType == javax.el.MethodExpression.class) {
if (expectedType == jakarta.el.MethodExpression.class) {

if (expectedReturnType == null) {
expectedReturnType = "Void";
Expand Down
4 changes: 2 additions & 2 deletions impl/src/main/java/org/apache/jasper/compiler/PageInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public class PageInfo {
* generated code.
*/
private static final String[] STANDARD_IMPORTS = {
"javax.servlet.*",
"javax.servlet.http.*",
"jakarta.servlet.*",
"jakarta.servlet.http.*",
"jakarta.servlet.jsp.*"
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ public void visit(Node.AttributeDirective n) throws JasperException {
}
} else if (type == null) {
if (isDeferredValue) {
type = "javax.el.ValueExpression";
type = "jakarta.el.ValueExpression";
} else if (isDeferredMethod) {
type = "javax.el.MethodExpression";
type = "jakarta.el.MethodExpression";
} else {
type = "java.lang.String";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import java.util.*;
import java.io.*;
import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

import org.apache.jasper.Constants;
import org.apache.jasper.JasperException;
Expand Down
6 changes: 3 additions & 3 deletions impl/src/main/java/org/apache/jasper/compiler/Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Hashtable;
import java.util.Iterator;

import javax.el.FunctionMapper;
import jakarta.el.FunctionMapper;
import jakarta.servlet.jsp.tagext.FunctionInfo;
import jakarta.servlet.jsp.tagext.JspFragment;
import jakarta.servlet.jsp.tagext.PageData;
Expand Down Expand Up @@ -1029,14 +1029,14 @@ private void checkSetter(Node.CustomTag n, TagAttributeInfo tldattr)
}
return;
}
if (! "javax.el.ValueExpression".equals(typeName)) {
if (! "jakarta.el.ValueExpression".equals(typeName)) {
err.jspError(n, "jsp.error.setter.notvalueexpression",
handlerName, property);
}
return;
}
if (tldattr.isDeferredMethod()) {
if (! "javax.el.MethodExpression".equals(typeName)) {
if (! "jakarta.el.MethodExpression".equals(typeName)) {
err.jspError(n, "jsp.error.setter.notmethodexpression",
handlerName, property);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.io.Reader;
import java.io.Writer;
import java.io.OutputStreamWriter;
import javax.servlet.ServletResponse;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.tagext.BodyContent;
import org.apache.jasper.Constants;
Expand Down
10 changes: 5 additions & 5 deletions impl/src/main/java/org/apache/jasper/runtime/ELContextImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

package org.apache.jasper.runtime;

import javax.el.ELContext;
import javax.el.ELResolver;
import javax.el.FunctionMapper;
import javax.el.VariableMapper;
import jakarta.el.ELContext;
import jakarta.el.ELResolver;
import jakarta.el.FunctionMapper;
import jakarta.el.VariableMapper;

/**
* Concrete implementation of {@link javax.el.ELContext}.
* Concrete implementation of {@link jakarta.el.ELContext}.
* ELContext's constructor is protected to control creation of ELContext
* objects through their appropriate factory methods. This version of
* ELContext forces construction through JspApplicationContextImpl.
Expand Down
Loading

0 comments on commit 7f7b0ea

Please sign in to comment.