Skip to content

Commit

Permalink
Update to Jakarta servlet-api 5.
Browse files Browse the repository at this point in the history
- Major bump of Butterfly version to 2.0.0.
  to reflect new package names
  • Loading branch information
tfmorris committed Dec 27, 2023
1 parent a0d44fb commit 4ce3e87
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>org.openrefine.dependencies</groupId>
<artifactId>butterfly-container</artifactId>
<version>1.2.6-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<groupId>org.openrefine.dependencies</groupId>
<artifactId>butterfly</artifactId>
<version>1.2.6-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>

<name>SIMILE Butterfly Engine</name>
<url>https://github.com/OpenRefine/simile-butterfly/</url>
Expand Down Expand Up @@ -93,9 +93,9 @@
<version>1.7.14</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>com.metaweb</groupId>
Expand Down
18 changes: 9 additions & 9 deletions main/src/edu/mit/simile/butterfly/Butterfly.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
import java.util.Timer;
import java.util.TimerTask;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.ex.ConfigurationException;
Expand Down Expand Up @@ -461,7 +461,7 @@ protected void initializeModule(String name, Set<String> initialized, Set<String
}

@Override
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String method = request.getMethod();
String path = request.getPathInfo();
String urlQuery = request.getQueryString();
Expand Down Expand Up @@ -850,7 +850,7 @@ protected void configureModules() {
}

List<String> scriptables = p.getList(String.class, "scriptables");
if (!scriptables.isEmpty()) {
if (scriptables != null && !scriptables.isEmpty()) {
Context context = Context.enter();

for (String scriptable : scriptables) {
Expand Down
8 changes: 4 additions & 4 deletions main/src/edu/mit/simile/butterfly/ButterflyModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import java.util.Set;
import java.util.Timer;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.velocity.VelocityContext;
Expand Down
8 changes: 4 additions & 4 deletions main/src/edu/mit/simile/butterfly/ButterflyModuleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.collections4.OrderedMap;
import org.apache.commons.collections4.OrderedMapIterator;
Expand Down
2 changes: 1 addition & 1 deletion main/src/edu/mit/simile/butterfly/ButterflyMounter.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
4 changes: 2 additions & 2 deletions main/src/edu/mit/simile/butterfly/ScriptableButterfly.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.testng.annotations.BeforeSuite;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.mit.simile.butterfly.tests;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.testng.Assert;
import org.testng.annotations.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package edu.mit.simile.butterfly.tests;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.slf4j.LoggerFactory;
import org.testng.Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import java.util.List;
import java.util.Map;

import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.velocity.VelocityContext;

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.openrefine.dependencies</groupId>
<artifactId>butterfly-container</artifactId>
<version>1.2.6-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>SIMILE Butterfly</name>
Expand Down
2 changes: 1 addition & 1 deletion server/src/edu/mit/simile/butterfly/ButterflyServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static void main(String[] args) throws Exception {

// tell jetty to use SLF4J for logging instead of its own stuff
System.setProperty("VERBOSE","false");
// FIXME: SLF4J is the default now, so this can probably be removed
System.setProperty("org.eclipse.jetty.util.log.class","org.eclipse.jetty.util.log.Slf4jLog");

port = Configurations.getInteger("server.port",DEFAULT_PORT);
Expand Down Expand Up @@ -347,4 +348,3 @@ public void removeLifeCycleListener(Listener listener) {
System.err.println("we should implement this!");
}
}

0 comments on commit 4ce3e87

Please sign in to comment.