Author: markt
Date: Thu Dec 29 19:44:04 2011
New Revision: 1225626
URL: http://svn.apache.org/viewvc?rev=1225626&view=rev
Log:
UCDetector changes. Make read-only fields final
Modified:
tomcat/trunk/java/org/apache/naming/resources/ProxyDirContext.java
tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java
tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java
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=1225626&r1=1225625&r2=1225626&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:44:04 2011
@@ -73,6 +73,10 @@ public class ProxyDirContext implements
public ProxyDirContext(Hashtable<String,String> env,
DirContext dirContext) {
this.dirContext = dirContext;
+
+ ResourceCache cache = null;
+ int cacheTTL = 5000; // 5s
+ int cacheObjectMaxSize = 512; // 512 KB
if (dirContext instanceof BaseDirContext) {
// Initialize parameters based on the associated dir context, like
// the caching policy.
@@ -95,6 +99,10 @@ public class ProxyDirContext implements
}
}
}
+ this.cache = cache;
+ this.cacheTTL = cacheTTL;
+ this.cacheObjectMaxSize = cacheObjectMaxSize;
+
hostName = env.get(HOST);
contextName = env.get(CONTEXT);
int i = contextName.indexOf('#');
@@ -150,19 +158,19 @@ public class ProxyDirContext implements
/**
* Cache.
*/
- protected ResourceCache cache = null;
+ protected final ResourceCache cache;
/**
* Cache TTL.
*/
- protected int cacheTTL = 5000; // 5s
+ protected final int cacheTTL;
/**
* Max size of resources which will have their content cached.
*/
- protected int cacheObjectMaxSize = 512; // 512 KB
+ protected final int cacheObjectMaxSize;
/**
Modified: tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java?rev=1225626&r1=1225625&r2=1225626&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/ResourceCache.java Thu Dec 29
19:44:04 2011
@@ -44,7 +44,7 @@ public class ResourceCache {
/**
* Random generator used to determine elements to free.
*/
- protected Random random = new Random();
+ protected final Random random = new Random();
/**
@@ -57,7 +57,7 @@ public class ResourceCache {
/**
* Not found cache.
*/
- protected HashMap<String,CacheEntry> notFoundCache =
+ protected final HashMap<String,CacheEntry> notFoundCache =
new HashMap<String,CacheEntry>();
Modified: tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java?rev=1225626&r1=1225625&r2=1225626&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java Thu Dec 29
19:44:04 2011
@@ -73,6 +73,8 @@ public class WARDirContext extends BaseD
/**
* Builds a WAR directory context using the given environment.
+ * Note: The environment is unused by Tomcat but required since we use the
+ * DirContext interface
*/
public WARDirContext(Hashtable<String,Object> env) {
super(env);
@@ -880,10 +882,10 @@ public class WARDirContext extends BaseD
// --------------------------------------------------- Member Variables
- protected String name = null;
+ protected final String name;
- protected ZipEntry entry = null;
+ protected final ZipEntry entry;
protected Entry children[] = new Entry[0];
@@ -969,7 +971,7 @@ public class WARDirContext extends BaseD
// --------------------------------------------------- Member Variables
- protected ZipEntry entry;
+ protected final ZipEntry entry;
// ----------------------------------------------------- Public Methods
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]