Author: markt
Date: Thu Dec 29 19:35:29 2011
New Revision: 1225625

URL: http://svn.apache.org/viewvc?rev=1225625&view=rev
Log:
UCDetector changes

Modified:
    tomcat/trunk/java/org/apache/naming/ContextAccessController.java
    tomcat/trunk/java/org/apache/naming/NamingContext.java
    tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java
    tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java
    tomcat/trunk/java/org/apache/naming/NamingEntry.java
    tomcat/trunk/java/org/apache/naming/ResourceEnvRef.java
    tomcat/trunk/java/org/apache/naming/ResourceLinkRef.java
    tomcat/trunk/java/org/apache/naming/SelectorContext.java
    tomcat/trunk/java/org/apache/naming/ServiceRef.java
    tomcat/trunk/java/org/apache/naming/StringManager.java
    tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceProxy.java
    
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java
    tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java
    tomcat/trunk/java/org/apache/naming/resources/CacheEntry.java
    tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
    
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java
    
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandlerFactory.java
    tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java
    tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java
    
tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
    tomcat/trunk/java/org/apache/naming/resources/Resource.java
    tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java

Modified: tomcat/trunk/java/org/apache/naming/ContextAccessController.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/ContextAccessController.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/ContextAccessController.java (original)
+++ tomcat/trunk/java/org/apache/naming/ContextAccessController.java Thu Dec 29 
19:35:29 2011
@@ -36,14 +36,14 @@ public class ContextAccessController {
     /**
      * Catalina context names on which writing is not allowed.
      */
-    private static Hashtable<Object,Object> readOnlyContexts =
+    private static final Hashtable<Object,Object> readOnlyContexts =
         new Hashtable<Object,Object>();
 
 
     /**
      * Security tokens repository.
      */
-    private static Hashtable<Object,Object> securityTokens =
+    private static final Hashtable<Object,Object> securityTokens =
         new Hashtable<Object,Object>();
 
 

Modified: tomcat/trunk/java/org/apache/naming/NamingContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContext.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingContext.java Thu Dec 29 19:35:29 
2011
@@ -102,7 +102,7 @@ public class NamingContext implements Co
     /**
      * Environment.
      */
-    protected Hashtable<String,Object> env;
+    protected final Hashtable<String,Object> env;
 
 
     /**
@@ -120,7 +120,7 @@ public class NamingContext implements Co
     /**
      * Name of the associated Catalina Context.
      */
-    protected String name;
+    protected final String name;
 
 
     /**

Modified: 
tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java 
(original)
+++ tomcat/trunk/java/org/apache/naming/NamingContextBindingsEnumeration.java 
Thu Dec 29 19:35:29 2011
@@ -52,13 +52,13 @@ public class NamingContextBindingsEnumer
     /**
      * Underlying enumeration.
      */
-    protected Iterator<NamingEntry> iterator;
+    protected final Iterator<NamingEntry> iterator;
 
 
     /**
      * The context for which this enumeration is being generated.
      */
-    private Context ctx;
+    private final Context ctx;
 
 
     // --------------------------------------------------------- Public Methods

Modified: tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingContextEnumeration.java Thu Dec 
29 19:35:29 2011
@@ -49,7 +49,7 @@ public class NamingContextEnumeration
     /**
      * Underlying enumeration.
      */
-    protected Iterator<NamingEntry> iterator;
+    protected final Iterator<NamingEntry> iterator;
 
 
     // --------------------------------------------------------- Public Methods

Modified: tomcat/trunk/java/org/apache/naming/NamingEntry.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingEntry.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingEntry.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingEntry.java Thu Dec 29 19:35:29 
2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.naming;
 
 
@@ -25,23 +23,14 @@ package org.apache.naming;
  * @author Remy Maucherat
  * @version $Id$
  */
-
 public class NamingEntry {
 
-
-    // -------------------------------------------------------------- Constants
-
-
     public static final int ENTRY = 0;
     public static final int LINK_REF = 1;
     public static final int REFERENCE = 2;
-
     public static final int CONTEXT = 10;
 
 
-    // ----------------------------------------------------------- Constructors
-
-
     public NamingEntry(String name, Object value, int type) {
         this.name = name;
         this.value = value;
@@ -49,21 +38,15 @@ public class NamingEntry {
     }
 
 
-    // ----------------------------------------------------- Instance Variables
-
-
     /**
      * The type instance variable is used to avoid using RTTI when doing
      * lookups.
      */
     public int type;
-    public String name;
+    public final String name;
     public Object value;
 
 
-    // --------------------------------------------------------- Object Methods
-
-
     @Override
     public boolean equals(Object obj) {
         if (obj instanceof NamingEntry) {
@@ -78,6 +61,4 @@ public class NamingEntry {
     public int hashCode() {
         return name.hashCode();
     }
-
-
 }

Modified: tomcat/trunk/java/org/apache/naming/ResourceEnvRef.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/ResourceEnvRef.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/ResourceEnvRef.java (original)
+++ tomcat/trunk/java/org/apache/naming/ResourceEnvRef.java Thu Dec 29 19:35:29 
2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.naming;
 
 import javax.naming.Context;
@@ -27,12 +25,10 @@ import javax.naming.Reference;
  * @author Remy Maucherat
  * @version $Id$
  */
-
 public class ResourceEnvRef extends Reference {
 
     private static final long serialVersionUID = 1L;
 
-    // -------------------------------------------------------------- Constants
 
     /**
      * Default factory for this reference.
@@ -41,9 +37,6 @@ public class ResourceEnvRef extends Refe
         org.apache.naming.factory.Constants.DEFAULT_RESOURCE_ENV_FACTORY;
 
 
-    // ----------------------------------------------------------- Constructors
-
-
     /**
      * Resource env reference.
      *
@@ -55,25 +48,6 @@ public class ResourceEnvRef extends Refe
 
 
     /**
-     * Resource env reference.
-     *
-     * @param resourceType Type
-     * @param factory The factory class
-     * @param factoryLocation The factory location
-     */
-    public ResourceEnvRef(String resourceType, String factory,
-                          String factoryLocation) {
-        super(resourceType, factory, factoryLocation);
-    }
-
-
-    // ----------------------------------------------------- Instance Variables
-
-
-    // ------------------------------------------------------ Reference Methods
-
-
-    /**
      * Retrieves the class name of the factory of the object to which this
      * reference refers.
      */
@@ -91,9 +65,4 @@ public class ResourceEnvRef extends Refe
             }
         }
     }
-
-
-    // ------------------------------------------------------------- Properties
-
-
 }

Modified: tomcat/trunk/java/org/apache/naming/ResourceLinkRef.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/ResourceLinkRef.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/ResourceLinkRef.java (original)
+++ tomcat/trunk/java/org/apache/naming/ResourceLinkRef.java Thu Dec 29 
19:35:29 2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.naming;
 
 import javax.naming.Context;
@@ -28,12 +26,10 @@ import javax.naming.StringRefAddr;
  * @author Remy Maucherat
  * @version $Id$
  */
-
 public class ResourceLinkRef extends Reference {
 
     private static final long serialVersionUID = 1L;
 
-    // -------------------------------------------------------------- Constants
 
     /**
      * Default factory for this reference.
@@ -48,20 +44,6 @@ public class ResourceLinkRef extends Ref
     public static final String GLOBALNAME = "globalName";
 
 
-    // ----------------------------------------------------------- Constructors
-
-
-    /**
-     * ResourceLink Reference.
-     *
-     * @param resourceClass Resource class
-     * @param globalName Global name
-     */
-    public ResourceLinkRef(String resourceClass, String globalName) {
-        this(resourceClass, globalName, null, null);
-    }
-
-
     /**
      * ResourceLink Reference.
      *
@@ -79,12 +61,6 @@ public class ResourceLinkRef extends Ref
     }
 
 
-    // ----------------------------------------------------- Instance Variables
-
-
-    // ------------------------------------------------------ Reference Methods
-
-
     /**
      * Retrieves the class name of the factory of the object to which this
      * reference refers.
@@ -103,9 +79,4 @@ public class ResourceLinkRef extends Ref
             }
         }
     }
-
-
-    // ------------------------------------------------------------- Properties
-
-
 }

Modified: tomcat/trunk/java/org/apache/naming/SelectorContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/SelectorContext.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/SelectorContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/SelectorContext.java Thu Dec 29 
19:35:29 2011
@@ -70,6 +70,7 @@ public class SelectorContext implements 
      */
     public SelectorContext(Hashtable<String,Object> env) {
         this.env = env;
+        this.initialContext = false;
     }
 
 
@@ -78,7 +79,7 @@ public class SelectorContext implements 
      */
     public SelectorContext(Hashtable<String,Object> env,
             boolean initialContext) {
-        this(env);
+        this.env = env;
         this.initialContext = initialContext;
     }
 
@@ -89,7 +90,7 @@ public class SelectorContext implements 
     /**
      * Environment.
      */
-    protected Hashtable<String,Object> env;
+    protected final Hashtable<String,Object> env;
 
 
     /**
@@ -101,7 +102,7 @@ public class SelectorContext implements 
     /**
      * Request for an initial context.
      */
-    protected boolean initialContext = false;
+    protected final boolean initialContext;
 
 
     // --------------------------------------------------------- Public Methods

Modified: tomcat/trunk/java/org/apache/naming/ServiceRef.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/ServiceRef.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/ServiceRef.java (original)
+++ tomcat/trunk/java/org/apache/naming/ServiceRef.java Thu Dec 29 19:35:29 2011
@@ -83,9 +83,10 @@ public class ServiceRef extends Referenc
 
 
     /**
-     * The vector to save the handler Reference objects, because they can't be 
saved in the addrs vector.
+     * The vector to save the handler Reference objects, because they can't be
+     * saved in the addrs vector.
      */
-    private Vector<HandlerRef> handlers = new Vector<HandlerRef>();
+    private final Vector<HandlerRef> handlers = new Vector<HandlerRef>();
 
 
     // ----------------------------------------------------------- Constructors

Modified: tomcat/trunk/java/org/apache/naming/StringManager.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/StringManager.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/StringManager.java (original)
+++ tomcat/trunk/java/org/apache/naming/StringManager.java Thu Dec 29 19:35:29 
2011
@@ -55,8 +55,8 @@ public class StringManager {
     /**
      * The ResourceBundle for this StringManager.
      */
-    private ResourceBundle bundle;
-    private Locale locale;
+    private final ResourceBundle bundle;
+    private final Locale locale;
 
     /**
      * Creates a new StringManager for a given package. This is a
@@ -68,8 +68,9 @@ public class StringManager {
      */
     private StringManager(String packageName) {
         String bundleName = packageName + ".LocalStrings";
+        ResourceBundle tempBundle = null;
         try {
-            bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault());
+            tempBundle = ResourceBundle.getBundle(bundleName, 
Locale.getDefault());
         } catch( MissingResourceException ex ) {
             // Try from the current loader (that's the case for trusted apps)
             // Should only be required if using a TC5 style classloader 
structure
@@ -77,7 +78,7 @@ public class StringManager {
             ClassLoader cl = Thread.currentThread().getContextClassLoader();
             if( cl != null ) {
                 try {
-                    bundle = ResourceBundle.getBundle(
+                    tempBundle = ResourceBundle.getBundle(
                             bundleName, Locale.getDefault(), cl);
                 } catch(MissingResourceException ex2) {
                     // Ignore
@@ -85,9 +86,12 @@ public class StringManager {
             }
         }
         // Get the actual locale, which may be different from the requested one
-        if (bundle != null) {
-            locale = bundle.getLocale();
+        if (tempBundle != null) {
+            locale = tempBundle.getLocale();
+        } else {
+            locale = null;
         }
+        bundle = tempBundle;
     }
 
     /**
@@ -149,7 +153,7 @@ public class StringManager {
     // STATIC SUPPORT METHODS
     // --------------------------------------------------------------
 
-    private static Hashtable<String, StringManager> managers =
+    private static final Hashtable<String, StringManager> managers =
         new Hashtable<String, StringManager>();
 
     /**

Modified: 
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceProxy.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceProxy.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceProxy.java 
(original)
+++ tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceProxy.java 
Thu Dec 29 19:35:29 2011
@@ -14,8 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.naming.factory.webservices;
 
 import java.lang.reflect.InvocationHandler;
@@ -34,15 +32,13 @@ import javax.xml.rpc.ServiceException;
  *
  * @author Fabien Carrion
  */
-
-public class ServiceProxy
-    implements InvocationHandler {
+public class ServiceProxy implements InvocationHandler {
 
     /**
      * Service object.
      * used for delegation
      */
-    private Service service = null;
+    private final Service service;
 
     /**
      * changing behavior to method : Service.getPort(QName, Class)

Modified: 
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java 
(original)
+++ 
tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java 
Thu Dec 29 19:35:29 2011
@@ -56,28 +56,10 @@ import org.apache.naming.ServiceRef;
  *
  * @author Fabien Carrion
  */
-
-public class ServiceRefFactory
-    implements ObjectFactory {
-
-
-    // ----------------------------------------------------------- Constructors
-
-
-    // -------------------------------------------------------------- Constants
-
-
-    // ----------------------------------------------------- Instance Variables
-
-
-    // --------------------------------------------------------- Public Methods
-
-
-    // -------------------------------------------------- ObjectFactory Methods
-
+public class ServiceRefFactory implements ObjectFactory {
 
     /**
-     * Crete a new serviceref instance.
+     * Create a new serviceref instance.
      *
      * @param obj The reference object describing the webservice
      */

Modified: tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/BaseDirContext.java Thu Dec 
29 19:35:29 2011
@@ -94,7 +94,7 @@ public abstract class BaseDirContext imp
     /**
      * Environment.
      */
-    protected Hashtable<String,Object> env;
+    protected final Hashtable<String,Object> env;
 
 
     /**
@@ -104,12 +104,6 @@ public abstract class BaseDirContext imp
 
 
     /**
-     * Name parser for this context.
-     */
-    protected final NameParser nameParser = new NameParserImpl();
-
-
-    /**
      * Cached.
      */
     protected boolean cached = true;
@@ -136,7 +130,7 @@ public abstract class BaseDirContext imp
     /**
      * Aliases allow content to be included from other locations.
      */
-    protected Map<String,BaseDirContext> aliases =
+    protected final Map<String,BaseDirContext> aliases =
         new HashMap<String,BaseDirContext>();
 
 
@@ -145,7 +139,7 @@ public abstract class BaseDirContext imp
      * searched in the order they are added if the requested resource cannot be
      * found in the primary DirContext.
      */
-    protected List<DirContext> altDirContexts = new ArrayList<DirContext>();
+    protected final List<DirContext> altDirContexts = new 
ArrayList<DirContext>();
 
 
     // ------------------------------------------------------------- Properties

Modified: tomcat/trunk/java/org/apache/naming/resources/CacheEntry.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/CacheEntry.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/CacheEntry.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/CacheEntry.java Thu Dec 29 
19:35:29 2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.naming.resources;
 
 import javax.naming.directory.DirContext;
@@ -27,10 +26,6 @@ import javax.naming.directory.DirContext
  */
 public class CacheEntry {
 
-
-    // ------------------------------------------------- Instance Variables
-
-
     public long timestamp = -1;
     public String name = null;
     public ResourceAttributes attributes = null;
@@ -41,21 +36,6 @@ public class CacheEntry {
     public int size = 1;
 
 
-    // ----------------------------------------------------- Public Methods
-
-
-    public void recycle() {
-        timestamp = -1;
-        name = null;
-        attributes = null;
-        resource = null;
-        context = null;
-        exists = true;
-        accessCount = 0;
-        size = 1;
-    }
-
-
     @Override
     public String toString() {
         return ("Cache entry: " + name + "\n"
@@ -64,6 +44,4 @@ public class CacheEntry {
                 + "Resource: " + resource + "\n"
                 + "Context: " + context);
     }
-
-
 }

Modified: 
tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java 
(original)
+++ tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java 
Thu Dec 29 19:35:29 2011
@@ -68,8 +68,10 @@ public class DirContextURLConnection
             throw new IllegalArgumentException
                 ("Directory context can't be null");
         if (org.apache.naming.Constants.IS_SECURITY_ENABLED) {
-            this.permission = new JndiPermission(url.toString());
-    }
+            permission = new JndiPermission(url.toString());
+        } else {
+            permission = null;
+        }
         this.context = context;
     }
 
@@ -80,7 +82,7 @@ public class DirContextURLConnection
     /**
      * Directory context.
      */
-    protected DirContext context;
+    protected final DirContext context;
 
 
     /**
@@ -116,7 +118,7 @@ public class DirContextURLConnection
     /**
      * Permission
      */
-    protected Permission permission;
+    protected final Permission permission;
 
 
     // ------------------------------------------------------------- Properties

Modified: 
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java 
(original)
+++ 
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandler.java 
Thu Dec 29 19:35:29 2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.naming.resources;
 
 import java.io.IOException;
@@ -38,7 +37,7 @@ public class DirContextURLStreamHandler 
 
 
     public DirContextURLStreamHandler() {
-        // NOOP
+        this.context = null;
     }
 
 
@@ -53,14 +52,14 @@ public class DirContextURLStreamHandler 
     /**
      * Bindings class loader - directory context. Keyed by CL id.
      */
-    private static Hashtable<ClassLoader,DirContext> clBindings =
+    private static final Hashtable<ClassLoader,DirContext> clBindings =
         new Hashtable<ClassLoader,DirContext>();
 
 
     /**
      * Bindings thread - directory context. Keyed by thread id.
      */
-    private static Hashtable<Thread,DirContext> threadBindings =
+    private static final Hashtable<Thread,DirContext> threadBindings =
         new Hashtable<Thread,DirContext>();
 
 
@@ -70,7 +69,7 @@ public class DirContextURLStreamHandler 
     /**
      * Directory context.
      */
-    protected DirContext context = null;
+    protected final DirContext context;
 
 
     // ------------------------------------------------------------- Properties
@@ -150,19 +149,11 @@ public class DirContextURLStreamHandler 
 
 
     /**
-     * Returns true if the thread or the context class loader of the current
-     * thread is bound.
-     */
-    public static boolean isBound() {
-        return (clBindings.containsKey
-                (Thread.currentThread().getContextClassLoader()))
-            || (threadBindings.containsKey(Thread.currentThread()));
-    }
-
-
-    /**
      * Binds a directory context to a class loader.
+     * @deprecated Unused in Tomcat. Will remove in Tomcat 9 unless someone
+     *             complains.
      */
+    @Deprecated
     public static void bind(DirContext dirContext) {
         ClassLoader currentCL =
             Thread.currentThread().getContextClassLoader();
@@ -173,7 +164,10 @@ public class DirContextURLStreamHandler 
 
     /**
      * Unbinds a directory context to a class loader.
+     * @deprecated Unused in Tomcat. Will remove in Tomcat 9 unless someone
+     *             complains.
      */
+    @Deprecated
     public static void unbind() {
         ClassLoader currentCL =
             Thread.currentThread().getContextClassLoader();
@@ -247,22 +241,4 @@ public class DirContextURLStreamHandler 
     public static void unbind(ClassLoader cl) {
         clBindings.remove(cl);
     }
-
-
-    /**
-     * Get the bound context.
-     */
-    public static DirContext get(ClassLoader cl) {
-        return clBindings.get(cl);
-    }
-
-
-    /**
-     * Get the bound context.
-     */
-    public static DirContext get(Thread thread) {
-        return threadBindings.get(thread);
-    }
-
-
 }

Modified: 
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandlerFactory.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandlerFactory.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandlerFactory.java
 (original)
+++ 
tomcat/trunk/java/org/apache/naming/resources/DirContextURLStreamHandlerFactory.java
 Thu Dec 29 19:35:29 2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.naming.resources;
 
 import java.net.URLStreamHandler;
@@ -33,7 +32,7 @@ public class DirContextURLStreamHandlerF
         implements URLStreamHandlerFactory {
 
     // Singleton
-    private static DirContextURLStreamHandlerFactory instance =
+    private static final DirContextURLStreamHandlerFactory instance =
         new DirContextURLStreamHandlerFactory();
 
     public static DirContextURLStreamHandlerFactory getInstance() {
@@ -45,7 +44,7 @@ public class DirContextURLStreamHandlerF
     }
 
 
-    private List<URLStreamHandlerFactory> userFactories =
+    private final List<URLStreamHandlerFactory> userFactories =
         new CopyOnWriteArrayList<URLStreamHandlerFactory>();
 
     private DirContextURLStreamHandlerFactory() {

Modified: tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java Thu Dec 
29 19:35:29 2011
@@ -912,7 +912,7 @@ public class FileDirContext extends Base
         /**
          * Associated file object.
          */
-        protected File file;
+        protected final File file;
 
 
         // --------------------------------------------------- Resource Methods
@@ -961,7 +961,7 @@ public class FileDirContext extends Base
         // --------------------------------------------------- Member Variables
 
 
-        protected File file;
+        protected final File file;
 
 
         protected boolean accessed = false;

Modified: tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java 
(original)
+++ tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java Thu Dec 
29 19:35:29 2011
@@ -72,7 +72,6 @@ public class ProxyDirContext implements 
      */
     public ProxyDirContext(Hashtable<String,String> env,
             DirContext dirContext) {
-        this.env = env;
         this.dirContext = dirContext;
         if (dirContext instanceof BaseDirContext) {
             // Initialize parameters based on the associated dir context, like
@@ -111,18 +110,6 @@ public class ProxyDirContext implements 
 
 
     /**
-     * Proxy DirContext (either this or the real proxy).
-     */
-    protected ProxyDirContext proxy = this;
-
-
-    /**
-     * Environment.
-     */
-    protected Hashtable<String,String> env;
-
-
-    /**
      * The string manager for this package.
      */
     protected static final StringManager sm =
@@ -132,37 +119,31 @@ public class ProxyDirContext implements 
     /**
      * Associated DirContext.
      */
-    protected DirContext dirContext;
-
-
-    /**
-     * Virtual path.
-     */
-    protected String vPath = null;
+    protected final DirContext dirContext;
 
 
     /**
      * Host name.
      */
-    protected String hostName;
+    protected final String hostName;
 
 
     /**
      * Context name.
      */
-    protected String contextName;
+    protected final String contextName;
 
 
     /**
      * Context path.
      */
-    protected String contextPath;
+    protected final String contextPath;
 
 
     /**
      * Cache class.
      */
-    protected String cacheClassName =
+    protected final String cacheClassName =
         "org.apache.naming.resources.ResourceCache";
 
 
@@ -187,7 +168,7 @@ public class ProxyDirContext implements 
     /**
      * Non cacheable resources.
      */
-    protected String[] nonCacheable = { "/WEB-INF/lib/", "/WEB-INF/classes/" };
+    protected final String[] nonCacheable = { "/WEB-INF/lib/", 
"/WEB-INF/classes/" };
 
 
     // --------------------------------------------------------- Public Methods

Modified: 
tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java 
(original)
+++ 
tomcat/trunk/java/org/apache/naming/resources/RecyclableNamingEnumeration.java 
Thu Dec 29 19:35:29 2011
@@ -50,7 +50,7 @@ public class RecyclableNamingEnumeration
     /**
      * Entries.
      */
-    protected Vector<E> entries;
+    protected final Vector<E> entries;
 
 
     /**

Modified: tomcat/trunk/java/org/apache/naming/resources/Resource.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/Resource.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/Resource.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/Resource.java Thu Dec 29 
19:35:29 2011
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.naming.resources;
 
 import java.io.ByteArrayInputStream;
@@ -32,7 +31,6 @@ public class Resource {
 
     // ----------------------------------------------------------- Constructors
 
-
     public Resource() {
         // NO-OP
     }
@@ -43,14 +41,8 @@ public class Resource {
     }
 
 
-    public Resource(byte[] binaryContent) {
-        setContent(binaryContent);
-    }
-
-
     // ----------------------------------------------------- Instance Variables
 
-
     /**
      * Binary content.
      */
@@ -65,7 +57,6 @@ public class Resource {
 
     // ------------------------------------------------------------- Properties
 
-
     /**
      * Content accessor.
      *
@@ -108,6 +99,4 @@ public class Resource {
     public void setContent(byte[] binaryContent) {
         this.binaryContent = binaryContent;
     }
-
-
 }

Modified: tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java?rev=1225625&r1=1225624&r2=1225625&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java 
(original)
+++ tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java Thu 
Dec 29 19:35:29 2011
@@ -164,7 +164,7 @@ public class ResourceAttributes implemen
      * Default constructor.
      */
     public ResourceAttributes() {
-        // NO-OP
+        this.attributes = null;
     }
 
 
@@ -248,7 +248,7 @@ public class ResourceAttributes implemen
     /**
      * External attributes.
      */
-    protected Attributes attributes = null;
+    protected final Attributes attributes;
 
 
     // ------------------------------------------------------------- Properties



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

Reply via email to