diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/ServletCallbackHandler.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/ServletCallbackHandler.java index 65819e5fd9a..e65d97a2589 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/ServletCallbackHandler.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/ServletCallbackHandler.java @@ -126,14 +126,14 @@ public class ServletCallbackHandler implements CallbackHandler public CallerPrincipalCallback getThreadCallerPrincipalCallback() { CallerPrincipalCallback callerPrincipalCallback = _callerPrincipals.get(); - _callerPrincipals.remove(); + _callerPrincipals.set(null); return callerPrincipalCallback; } public GroupPrincipalCallback getThreadGroupPrincipalCallback() { GroupPrincipalCallback groupPrincipalCallback = _groupPrincipals.get(); - _groupPrincipals.remove(); + _groupPrincipals.set(null); return groupPrincipalCallback; } } diff --git a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java index 8e0a5f7d19a..e170c0ddbc0 100644 --- a/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java +++ b/jetty-jndi/src/main/java/org/eclipse/jetty/jndi/ContextFactory.java @@ -211,7 +211,6 @@ public class ContextFactory implements ObjectFactory return (Context)__contextMap.get(loader); } - /** * Associate the given Context with the current thread. * disassociate method should be called to reset the context. @@ -227,10 +226,9 @@ public class ContextFactory implements ObjectFactory public static void disassociateContext(final Context ctx) { - __threadContext.remove(); + __threadContext.set(null); } - public static ClassLoader associateClassLoader(final ClassLoader loader) { ClassLoader prev = (ClassLoader)__threadClassLoader.get(); @@ -238,10 +236,9 @@ public class ContextFactory implements ObjectFactory return prev; } - public static void disassociateClassLoader () { - __threadClassLoader.remove(); + __threadClassLoader.set(null); } public static void dump(Appendable out, String indent) throws IOException @@ -259,5 +256,4 @@ public class ContextFactory implements ObjectFactory context.dump(out,indent+(last?" ":" | ")); } } - } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index 3f845fb119b..ee7f544dec4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -86,10 +86,7 @@ public class HttpChannel implements HttpParser.RequestHandler, Runnable, H protected static HttpChannel setCurrentHttpChannel(HttpChannel channel) { HttpChannel last=__currentChannel.get(); - if (channel==null) - __currentChannel.remove(); - else - __currentChannel.set(channel); + __currentChannel.set(channel); return last; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 5d4ce4de6b7..4bd90329df5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -80,10 +80,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http protected static HttpConnection setCurrentConnection(HttpConnection connection) { HttpConnection last=__currentConnection.get(); - if (connection==null) - __currentConnection.remove(); - else - __currentConnection.set(connection); + __currentConnection.set(connection); return last; } diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java index 0343034d333..60de11cbc60 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java @@ -496,7 +496,7 @@ public class GzipFilter extends UserAgentFilter _allocatedDeflater = new Deflater(_deflateCompressionLevel,_deflateNoWrap); else { - _deflater.remove(); + _deflater.set(null); _allocatedDeflater.reset(); } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/NonBlockingThread.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/NonBlockingThread.java index 4fb75c7fb0c..fc0a4224208 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/NonBlockingThread.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/NonBlockingThread.java @@ -53,7 +53,7 @@ public class NonBlockingThread implements Runnable } finally { - __nonBlockingThread.remove(); + __nonBlockingThread.set(Boolean.FALSE); } } }