tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arvind Srinivasan <arvind.sriniva...@sun.com>
Subject ArrayIndexOutOfBoundsException in WebappClassLoader
Date Sat, 15 Jun 2002 09:39:24 GMT

I'm unable to reproduce this easily but I was running some tests (using
a multithreaded load generator) on a 4 cpu machine and encountered a
couple of ArrayIndexOutOfBoundsException @ lines 1747 and 1754 in
o.a.c.loaders.WebappClassLoader.java.


737            // Register the full path for modification checking
1738           synchronized (paths) {
1739            
1740                int j;
1741  
1742                long[] result2 = 
1743                    new long[lastModifiedDates.length + 1];
1744                for (j = 0; j < lastModifiedDates.length; j++) {
1745                    result2[j] = lastModifiedDates[j];
1746                }
1747                result2[lastModifiedDates.length] =
entry.lastModified;
1748                lastModifiedDates = result2;
1749   
1750                String[] result = new String[paths.length + 1];
1751                for (j = 0; j < paths.length; j++) {
1752                    result[j] = paths[j];
1753                }
1754                result[paths.length] = fullPath;
1755                paths = result;
1756   
1757            }

Shouldn't line 1738 synchronize on 'this' rather than 'paths' because
'paths' is changed to point to a new array within the synchronized block
itself @ line 1755 ?

Thanks,
 Arvind

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


Mime
View raw message