Author: markt
Date: Thu Dec  5 23:06:11 2013
New Revision: 1548325

URL: http://svn.apache.org/r1548325
Log:
Fix a file locking issue with TLD files.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java?rev=1548325&r1=1548324&r2=1548325&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java Thu Dec  5 
23:06:11 2013
@@ -116,6 +116,12 @@ public class TldCache {
             URL url = 
servletContext.getResource(tldResourcePath.getWebappPath());
             URLConnection conn = url.openConnection();
             result[0] = conn.getLastModified();
+            if ("file".equals(url.getProtocol())) {
+                // Reading the last modified time opens an input stream so we
+                // need to make sure it is closed again otherwise the TLD file
+                // will be locked until GC runs.
+                conn.getInputStream().close();
+            }
             Jar jar = tldResourcePath.getJar();
             if (jar != null) {
                 result[1] = 
jar.getLastModified(tldResourcePath.getEntryName());



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

Reply via email to