Author: markt Date: Tue Aug 5 12:55:20 2014 New Revision: 1615920 URL: http://svn.apache.org/r1615920 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56785 Avoid NullPointerException if directory exists on the class path that is not readable by the Tomcat user.
Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1615920&r1=1615919&r2=1615920&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Tue Aug 5 12:55:20 2014 @@ -1960,10 +1960,13 @@ public class ContextConfig implements Li boolean handlesTypesOnly) { if (file.isDirectory()) { + // Returns null if directory is not readable String[] dirs = file.list(); - for (String dir : dirs) { - processAnnotationsFile( - new File(file,dir), fragment, handlesTypesOnly); + if (dirs != null) { + for (String dir : dirs) { + processAnnotationsFile( + new File(file,dir), fragment, handlesTypesOnly); + } } } else if (file.canRead() && file.getName().endsWith(".class")) { try (FileInputStream fis = new FileInputStream(file)) { Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1615920&r1=1615919&r2=1615920&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue Aug 5 12:55:20 2014 @@ -81,6 +81,11 @@ Cédric Couralet. (markt) </fix> <fix> + <bug>56785</bug>: Avoid <code>NullPointerException</code> if directory + exists on the class path that is not readable by the Tomcat user. + (markt) + </fix> + <fix> <bug>56796</bug>: Remove unnecessary sleep when stopping a web application. (markt) </fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org