tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40170] - ArrayIndexOutOfBoundsException in ResourceCache
Date Wed, 02 Aug 2006 18:10:38 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40170>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40170





------- Additional Comments From jamey@jamescourtney.net  2006-08-02 18:10 -------
Remy Maucherat already applied this fix to the Tomcat 6.0.x code base:



Author: remm
Date: Tue Aug  1 17:39:28 2006
New Revision: 427821

URL: http://svn.apache.org/viewvc?rev=427821&view=rev
Log:
- Use a single reference to the cache during lookup (the cache array could be 
concurrently replaced).

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/naming/resour
ces/ResourceCache.java?rev=427821&r1=427820&r2=427821&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/naming/resources/ResourceCache.
+++ java Tue Aug  1 17:39:28 2006
@@ -289,10 +289,11 @@
     public CacheEntry lookup(String name) {
 
         CacheEntry cacheEntry = null;
+        CacheEntry[] currentCache = cache;
         accessCount++;
-        int pos = find(cache, name);
-        if ((pos != -1) && (name.equals(cache[pos].name))) {
-            cacheEntry = cache[pos];
+        int pos = find(currentCache, name);
+        if ((pos != -1) && (name.equals(currentCache[pos].name))) {
+            cacheEntry = currentCache[pos];
         }
         if (cacheEntry == null) {
             try {



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message