From 200b3a3e6440cf45506b0c206aa395baaadc9df6 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 31 Dec 2014 16:28:35 +0100 Subject: [PATCH] fixed merge --- .../org/eclipse/jetty/server/MultiPartCleanerListener.java | 6 ++++++ .../src/test/java/org/eclipse/jetty/server/RequestTest.java | 2 +- .../main/java/org/eclipse/jetty/servlet/ServletHolder.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartCleanerListener.java b/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartCleanerListener.java index 93b706744b2..99328711857 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartCleanerListener.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/MultiPartCleanerListener.java @@ -28,6 +28,12 @@ import org.eclipse.jetty.util.MultiPartInputStreamParser; public class MultiPartCleanerListener implements ServletRequestListener { + public final static MultiPartCleanerListener INSTANCE = new MultiPartCleanerListener(); + + protected MultiPartCleanerListener() + { + } + @Override public void requestDestroyed(ServletRequestEvent sre) { diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java index 71445f6d967..eec5eb26921 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java @@ -292,7 +292,7 @@ public class RequestTest contextHandler.setContextPath("/foo"); contextHandler.setResourceBase("."); contextHandler.setHandler(new BadMultiPartRequestHandler(testTmpDir)); - contextHandler.addEventListener(new Request.MultiPartCleanerListener() + contextHandler.addEventListener(new MultiPartCleanerListener() { @Override diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java index 9da6942bffb..daa96fe48b5 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java @@ -696,7 +696,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope //servlet calling Request.getPart() or Request.getParts() ContextHandler ch = ContextHandler.getContextHandler(getServletHandler().getServletContext()); - ch.addEventListener(new MultiPartCleanerListener()); + ch.addEventListener(MultiPartCleanerListener.INSTANCE); } }