From: Markus Koschany <apo@debian.org>
Date: Thu, 2 Jan 2025 18:41:41 +0100
Subject: jetty9

Revert the change from jetty9 to jetty10 for now. The intention is to use
jetty12 in the near future anyway.
---
 extensions/gdata/pom.xml                           |  1 +
 main/webapp/WEB-INF/jetty-web.xml                  | 29 ----------------------
 main/webapp/WEB-INF/web.xml                        | 21 ++++++++++++----
 pom.xml                                            |  2 +-
 server/src/com/google/refine/Refine.java           |  5 ++--
 .../util/threads/ThreadPoolExecutorAdapter.java    | 13 +++++-----
 6 files changed, 26 insertions(+), 45 deletions(-)
 delete mode 100644 main/webapp/WEB-INF/jetty-web.xml

diff --git a/extensions/gdata/pom.xml b/extensions/gdata/pom.xml
index 7327e7b..fd5b5bb 100644
--- a/extensions/gdata/pom.xml
+++ b/extensions/gdata/pom.xml
@@ -54,6 +54,7 @@
                 <configuration>
                     <outputDirectory>module/MOD-INF/lib</outputDirectory>
                     <includeScope>runtime</includeScope>
+                    <excludeGroupIds>org.mortbay.jetty</excludeGroupIds>
                 </configuration>
                 </execution>
             </executions>
diff --git a/main/webapp/WEB-INF/jetty-web.xml b/main/webapp/WEB-INF/jetty-web.xml
deleted file mode 100644
index 73d9140..0000000
--- a/main/webapp/WEB-INF/jetty-web.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE Configure SYSTEM "https://www.eclipse.org/jetty/configure_10_0.dtd">
-<!-- =============================================================== -->
-<!-- Mixin the GZIP Handler                                          -->
-<!-- This applies the GZIP Handler to the entire server              -->
-<!-- If a GZIP handler is required for an individual context, then   -->
-<!-- use a context XML (see test.xml example in distribution)        -->
-<!-- =============================================================== -->
-<Configure class="org.eclipse.jetty.webapp.WebAppContext">
-    <Call name="insertHandler">
-        <Arg>
-            <New id="GzipHandler" class="org.eclipse.jetty.server.handler.gzip.GzipHandler">
-                <Set name="minGzipSize"><Property name="jetty.gzip.minGzipSize" deprecated="gzip.minGzipSize" default="2048"/></Set>
-                <Set name="inflateBufferSize"><Property name="jetty.gzip.inflateBufferSize" default="0"/></Set>
-                <Set name="syncFlush"><Property name="jetty.gzip.syncFlush" default="false" /></Set>
-
-                <Set name="includedMethodList"><Property name="jetty.gzip.includedMethodList" default="GET" /></Set>
-                <Set name="excludedMethodList"><Property name="jetty.gzip.excludedMethodList" default="" /></Set>
-
-                <Set name="dispatcherTypes" property="jetty.gzip.dispatcherTypes"/>
-                <Set name="includedMimeTypesList">
-                    <Property name="jetty.gzip.includedMimeTypeList" default="text/html,text/plain,text/xml,application/xhtml+xml,text/css,text/javascript,application/javascript,application/json,image/svg+xml"/>
-                </Set>
-                <Set name="excludedMimeTypesList" property="jetty.gzip.excludedMimeTypeList"/>
-                <Set name="includedPaths" property="jetty.gzip.includedPathList"/>
-                <Set name="excludedPaths" property="jetty.gzip.excludedPathList"/>
-            </New>
-        </Arg>
-    </Call>
-</Configure>
diff --git a/main/webapp/WEB-INF/web.xml b/main/webapp/WEB-INF/web.xml
index 4182ad8..11c1733 100644
--- a/main/webapp/WEB-INF/web.xml
+++ b/main/webapp/WEB-INF/web.xml
@@ -16,9 +16,23 @@
         | might require different parameters.
         +-->
     <context-param>
-        <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
+        <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
         <param-value>/</param-value>
     </context-param>
+	
+	<filter>
+      <filter-name>GzipFilter</filter-name>
+      <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
+      <init-param>
+        <param-name>mimeTypes</param-name>
+        <param-value>text/html,text/plain,text/xml,application/xhtml+xml,text/css,text/javascript,application/javascript,application/json,image/svg+xml</param-value>
+      </init-param>
+    </filter>
+    <filter-mapping>
+      <filter-name>GzipFilter</filter-name>
+      <url-pattern>/*</url-pattern>
+    </filter-mapping>
+    
     <servlet>
         <servlet-name>refine</servlet-name>
         <servlet-class>com.google.refine.RefineServlet</servlet-class>
@@ -30,10 +44,6 @@
             <param-name>refine.revision</param-name>
             <param-value>$REVISION</param-value>
         </init-param>
-        <init-param>
-            <param-name>gzip</param-name>
-            <param-value>true</param-value>
-        </init-param>
         <!-- added by Wikier, unused by us
         <init-param>
             <param-name>refine.data</param-name>
@@ -46,5 +56,6 @@
         <servlet-name>refine</servlet-name>
         <url-pattern>/*</url-pattern>
     </servlet-mapping>
+        
 
 </web-app>
diff --git a/pom.xml b/pom.xml
index dc31871..07bdb88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,7 +77,7 @@
     <butterfly.version>1.2.6</butterfly.version>
     <slf4j.version>2.0.12</slf4j.version>
     <log4j.version>2.22.1</log4j.version>
-    <jetty.version>10.0.16</jetty.version>
+    <jetty.version>9.4.52.v20230823</jetty.version>
     <okhttp.version>4.12.0</okhttp.version>
     <jena.version>4.10.0</jena.version>
     <poi.version>5.2.5</poi.version>
diff --git a/server/src/com/google/refine/Refine.java b/server/src/com/google/refine/Refine.java
index eafd966..622f345 100644
--- a/server/src/com/google/refine/Refine.java
+++ b/server/src/com/google/refine/Refine.java
@@ -44,7 +44,6 @@ import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import java.util.Set;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -224,7 +223,7 @@ class RefineServer extends Server {
         this.addBean(handler);
         // Tell the server we want to try and shutdown gracefully
         // this means that the server will stop accepting new connections
-        // right away, but it will continue to process the ones that
+        // right away but it will continue to process the ones that
         // are in execution for the given timeout before attempting to stop
         // NOTE: this is *not* a blocking method, it just sets a parameter
         // that _server.stop() will rely on
@@ -290,7 +289,7 @@ class RefineServer extends Server {
         scanner.addListener(new Scanner.BulkListener() {
 
             @Override
-            public void filesChanged(Set<String> set) {
+            public void filesChanged(@SuppressWarnings("rawtypes") List changedFiles) {
                 try {
                     logger.info("Stopping context: " + contextRoot.getAbsolutePath());
                     context.stop();
diff --git a/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java b/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java
index 1211cc9..561bc72 100644
--- a/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java
+++ b/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java
@@ -15,14 +15,13 @@
 
 package com.google.util.threads;
 
-import java.util.EventListener;
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
 import org.eclipse.jetty.util.component.LifeCycle;
+import org.eclipse.jetty.util.log.Log;
 import org.eclipse.jetty.util.thread.ThreadPool;
-import org.slf4j.LoggerFactory;
 
 /**
  * Jetty {@link ThreadPool} that bridges requests to a {@link ThreadPoolExecutor}.
@@ -40,7 +39,7 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle {
         try {
             executor.execute(job);
         } catch (RejectedExecutionException e) {
-            LoggerFactory.getLogger(this.toString()).warn("Execute failed", e);
+            Log.getLog().warn(e);
         }
     }
 
@@ -111,12 +110,12 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle {
     }
 
     @Override
-    public boolean addEventListener(EventListener eventListener) {
-        return false;
+    public void addLifeCycleListener(Listener listener) {
+        System.err.println("we should implement this!");
     }
 
     @Override
-    public boolean removeEventListener(EventListener eventListener) {
-        return false;
+    public void removeLifeCycleListener(Listener listener) {
+        System.err.println("we should implement this!");
     }
 }
