This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b88823  Remove unused code
8b88823 is described below

commit 8b8882349f0634467527404d0e5b74043d020708
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Apr 23 11:09:08 2019 +0100

    Remove unused code
---
 java/org/apache/tomcat/util/modeler/Registry.java | 34 ++---------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/java/org/apache/tomcat/util/modeler/Registry.java 
b/java/org/apache/tomcat/util/modeler/Registry.java
index c116b82..bea9c51 100644
--- a/java/org/apache/tomcat/util/modeler/Registry.java
+++ b/java/org/apache/tomcat/util/modeler/Registry.java
@@ -76,11 +76,6 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
     // Support for the factory methods
 
     /**
-     * Will be used to isolate different apps and enhance security.
-     */
-    private static final HashMap<Object, Registry> perLoaderRegistries = null;
-
-    /**
      * The registry instance created by our factory method the first time it is
      * called.
      */
@@ -131,38 +126,13 @@ public class Registry implements RegistryMBean, 
MBeanRegistration {
      * Factory method to create (if necessary) and return our
      * <code>Registry</code> instance.
      *
-     * The current version uses a static - future versions could use the thread
-     * class loader.
-     *
-     * @param key Support for application isolation. If null, the context class
-     *            loader will be used ( if setUseContextClassLoader is called )
-     *            or the default registry is returned.
+     * @param key Unused
      * @param guard Prevent access to the registry by untrusted components
+     *
      * @return the registry
      * @since 1.1
      */
     public static synchronized Registry getRegistry(Object key, Object guard) {
-        Registry localRegistry;
-        if (perLoaderRegistries != null) {
-            if (key == null)
-                key = Thread.currentThread().getContextClassLoader();
-            if (key != null) {
-                localRegistry = perLoaderRegistries.get(key);
-                if (localRegistry == null) {
-                    localRegistry = new Registry();
-                    // localRegistry.key=key;
-                    localRegistry.guard = guard;
-                    perLoaderRegistries.put(key, localRegistry);
-                    return localRegistry;
-                }
-                if (localRegistry.guard != null && localRegistry.guard != 
guard) {
-                    return null; // XXX Should I throw a permission ex ?
-                }
-                return localRegistry;
-            }
-        }
-
-        // static
         if (registry == null) {
             registry = new Registry();
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to