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:00:59 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:00 -------
I've noticed that I can configure my Context
(StandardContext) to increase the max cache size (cacheMaxSize parameter) 
which seems to help quite a bit with this problem.  Is this the recommended 
solution or should a code change also be considered to alleviate this 
problem?  I would suggest that the ResourceCache.lookup method should create a 
reference to the current cache which it should use rather than working on the 
global cache reference which may change.  Something like this:

/* current code, ResourceCache.java line 286 */ CacheEntry cacheEntry = 
null; ...
int pos = find(cache, name);
/* ArrayIndexOutOfBoundsException occurs when backing array modified between 
these lines */ if ((pos != -1) && (name.equals(cache[pos].name))) {
    cacheEntry = cache[pos];
}

/* new code */
CacheEntry cacheEntry = null;
CacheEntry[] currentCache = cache;
...
int pos = find(currentCache, name);
if ((pos != -1) && (name.equals(currentCache[pos].name))) {
    cacheEntry = currentCache[pos];
}



-- 
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