You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rz...@apache.org on 2022/10/26 06:30:28 UTC
[tomee] branch main updated: Adapt to new Tomcat threadNameBindings, use Map Interface instead of implementation
This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/main by this push:
new 6c44a92103 Adapt to new Tomcat threadNameBindings, use Map Interface instead of implementation
6c44a92103 is described below
commit 6c44a921037aaf743db85bab89423e215880c9f0
Author: Florian-Rau <57...@users.noreply.github.com>
AuthorDate: Wed Oct 26 07:31:10 2022 +0200
Adapt to new Tomcat threadNameBindings, use Map Interface instead of implementation
---
.../java/org/apache/tomee/catalina/TomcatThreadContextListener.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatThreadContextListener.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatThreadContextListener.java
index c591fa0c27..dd6af8a245 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatThreadContextListener.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatThreadContextListener.java
@@ -26,7 +26,7 @@ import javax.naming.NamingException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.Hashtable;
+import java.util.Map;
/**
* Tomcat thread context listener.
@@ -49,7 +49,7 @@ public class TomcatThreadContextListener implements ThreadContextListener {
* getThreadName method in class ContextBindings
*/
protected Method method;
- private Hashtable<Thread, Object> threadNameBindings;
+ private Map<Thread, Object> threadNameBindings;
/**
* Creates a new instance.
@@ -63,7 +63,7 @@ public class TomcatThreadContextListener implements ThreadContextListener {
final Field threadNameBindingsField = ContextBindings.class.getDeclaredField("threadObjectBindings");
threadNameBindingsField.setAccessible(true);
- threadNameBindings = (Hashtable<Thread, Object>) threadNameBindingsField.get(null);
+ threadNameBindings = (Map<Thread, Object>) threadNameBindingsField.get(null);
} catch (final Exception e) {
LOGGER.error("Expected ContextBinding to have the method getThreadName()");
}